Skip to content

Commit e3cb4b9

Browse files
Cleanup plugin fields
- group by parameters, components - add missing since tag
1 parent 81e390d commit e3cb4b9

File tree

1 file changed

+59
-45
lines changed

1 file changed

+59
-45
lines changed

src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java

+59-45
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,16 @@ public abstract class AbstractInvokerMojo
132132
* only indication of the build's success or failure will be the effect it has on the main build (if it fails, the
133133
* main build should fail as well). If {@link #streamLogs} is enabled, the sub-build summary will also provide an
134134
* indication.
135+
*
136+
* @since 1.0
135137
*/
136138
@Parameter( defaultValue = "false" )
137139
protected boolean suppressSummaries;
138140

139141
/**
140142
* Flag used to determine whether the build logs should be output to the normal mojo log.
143+
*
144+
* @since 1.0
141145
*/
142146
@Parameter( property = "invoker.streamLogs", defaultValue = "false" )
143147
private boolean streamLogs;
@@ -146,12 +150,16 @@ public abstract class AbstractInvokerMojo
146150
* The local repository for caching artifacts. It is strongly recommended to specify a path to an isolated
147151
* repository like <code>${project.build.directory}/it-repo</code>. Otherwise, your ordinary local repository will
148152
* be used, potentially soiling it with broken artifacts.
153+
*
154+
* @since 1.0
149155
*/
150156
@Parameter( property = "invoker.localRepositoryPath", defaultValue = "${settings.localRepository}" )
151157
private File localRepositoryPath;
152158

153159
/**
154160
* Directory to search for integration tests.
161+
*
162+
* @since 1.0
155163
*/
156164
@Parameter( property = "invoker.projectsDirectory", defaultValue = "${basedir}/src/it/" )
157165
private File projectsDirectory;
@@ -211,6 +219,8 @@ public abstract class AbstractInvokerMojo
211219

212220
/**
213221
* A single POM to build, skipping any scanning parameters and behavior.
222+
*
223+
* @since 1.0
214224
*/
215225
@Parameter( property = "invoker.pom" )
216226
private File pom;
@@ -224,6 +234,8 @@ public abstract class AbstractInvokerMojo
224234
* pattern <code>*</code> will run Maven builds on all immediate sub directories of {@link #projectsDirectory},
225235
* regardless if they contain a <code>pom.xml</code>. This allows to perform builds that need/should not depend on
226236
* the existence of a POM.
237+
*
238+
* @since 1.0
227239
*/
228240
@Parameter
229241
private List<String> pomIncludes = Collections.singletonList( "*/pom.xml" );
@@ -232,6 +244,8 @@ public abstract class AbstractInvokerMojo
232244
* Exclude patterns for searching the integration test directory. This parameter is meant to be set from the POM. By
233245
* default, no POM files are excluded. For the convenience of using an include pattern like <code>*</code>, the
234246
* custom settings file specified by the parameter {@link #settingsFile} will always be excluded automatically.
247+
*
248+
* @since 1.0
235249
*/
236250
@Parameter
237251
private List<String> pomExcludes = Collections.emptyList();
@@ -250,21 +264,12 @@ public abstract class AbstractInvokerMojo
250264

251265
/**
252266
* The list of goals to execute on each project. Default value is: <code>package</code>.
267+
*
268+
* @since 1.0
253269
*/
254270
@Parameter
255271
private List<String> goals = Collections.singletonList( "package" );
256272

257-
/**
258-
*/
259-
@Component
260-
private Invoker invoker;
261-
262-
@Component
263-
private SettingsBuilder settingsBuilder;
264-
265-
@Component
266-
private ToolchainManagerPrivate toolchainManagerPrivate;
267-
268273
/**
269274
* Relative path of a selector script to run prior in order to decide if the build should be executed. This script
270275
* may be written with either BeanShell or Groovy. If the file extension is omitted (e.g. <code>selector</code>),
@@ -287,6 +292,8 @@ public abstract class AbstractInvokerMojo
287292
* script exists for a particular project but returns any non-null value different from <code>true</code> or throws
288293
* an exception, the corresponding build is flagged as a failure. In this case, neither Maven nor the post-build
289294
* hook script will be invoked.
295+
*
296+
* @since 1.0
290297
*/
291298
@Parameter( property = "invoker.preBuildHookScript", defaultValue = "prebuild" )
292299
private String preBuildHookScript;
@@ -297,12 +304,16 @@ public abstract class AbstractInvokerMojo
297304
* plugin searches for the file by trying out the well-known extensions <code>.bsh</code> and <code>.groovy</code>.
298305
* If this script exists for a particular project but returns any non-null value different from <code>true</code> or
299306
* throws an exception, the corresponding build is flagged as a failure.
307+
*
308+
* @since 1.0
300309
*/
301310
@Parameter( property = "invoker.postBuildHookScript", defaultValue = "postbuild" )
302311
private String postBuildHookScript;
303312

304313
/**
305314
* Location of a properties file that defines CLI properties for the test.
315+
*
316+
* @since 1.0
306317
*/
307318
@Parameter( property = "invoker.testPropertiesFile", defaultValue = "test.properties" )
308319
private String testPropertiesFile;
@@ -317,18 +328,24 @@ public abstract class AbstractInvokerMojo
317328

318329
/**
319330
* Whether to show errors in the build output.
331+
*
332+
* @since 1.0
320333
*/
321334
@Parameter( property = "invoker.showErrors", defaultValue = "false" )
322335
private boolean showErrors;
323336

324337
/**
325338
* Whether to show debug statements in the build output.
339+
*
340+
* @since 1.0
326341
*/
327342
@Parameter( property = "invoker.debug", defaultValue = "false" )
328343
private boolean debug;
329344

330345
/**
331346
* Suppress logging to the <code>build.log</code> file.
347+
*
348+
* @since 1.0
332349
*/
333350
@Parameter( property = "invoker.noLog", defaultValue = "false" )
334351
private boolean noLog;
@@ -358,20 +375,6 @@ public abstract class AbstractInvokerMojo
358375
@Parameter
359376
private Map<String, String> filterProperties;
360377

361-
/**
362-
* The Maven Project Object
363-
*
364-
* @since 1.1
365-
*/
366-
@Parameter( defaultValue = "${project}", readonly = true, required = true )
367-
private MavenProject project;
368-
369-
@Parameter( defaultValue = "${session}", readonly = true, required = true )
370-
private MavenSession session;
371-
372-
@Parameter( defaultValue = "${mojoExecution}", readonly = true, required = true )
373-
private MojoExecution mojoExecution;
374-
375378
/**
376379
* A comma separated list of projectname patterns to run. Specify this parameter to run individual tests by file
377380
* name, overriding the {@link #setupIncludes}, {@link #pomIncludes} and {@link #pomExcludes} parameters. Each
@@ -440,14 +443,6 @@ public abstract class AbstractInvokerMojo
440443
@Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
441444
private String encoding;
442445

443-
/**
444-
* The current user system settings for use in Maven.
445-
*
446-
* @since 1.2
447-
*/
448-
@Parameter( defaultValue = "${settings}", readonly = true, required = true )
449-
private Settings settings;
450-
451446
/**
452447
* A flag whether the test class path of the project under test should be included in the class path of the
453448
* pre-/post-build scripts. If set to <code>false</code>, the class path of script interpreter consists only of the
@@ -460,12 +455,6 @@ public abstract class AbstractInvokerMojo
460455
@Parameter( property = "invoker.addTestClassPath", defaultValue = "false" )
461456
private boolean addTestClassPath;
462457

463-
/**
464-
* The test class path of the project under test.
465-
*/
466-
@Parameter( defaultValue = "${project.testClasspathElements}", readonly = true )
467-
private List<String> testClassPath;
468-
469458
/**
470459
* The name of an optional project-specific file that contains properties used to specify settings for an individual
471460
* Maven invocation. Any property present in the file will override the corresponding setting from the plugin
@@ -620,12 +609,6 @@ public abstract class AbstractInvokerMojo
620609
@Parameter( property = "invoker.parallelThreads", defaultValue = "1" )
621610
private String parallelThreads;
622611

623-
/**
624-
* @since 1.6
625-
*/
626-
@Parameter( property = "plugin.artifacts", required = true, readonly = true )
627-
private List<Artifact> pluginArtifacts;
628-
629612
/**
630613
* If enable and if you have a settings file configured for the execution, it will be merged with your user
631614
* settings.
@@ -681,6 +664,8 @@ public abstract class AbstractInvokerMojo
681664
@Parameter( defaultValue = "false", property = "invoker.updateOnly" )
682665
private boolean updateOnly = false;
683666

667+
// internal state variables
668+
684669
/**
685670
* The scripter runner that is responsible to execute hook scripts.
686671
*/
@@ -703,6 +688,35 @@ public abstract class AbstractInvokerMojo
703688
*/
704689
private String actualMavenVersion;
705690

691+
// used components - readonly parameters
692+
693+
@Parameter( property = "plugin.artifacts", required = true, readonly = true )
694+
private List<Artifact> pluginArtifacts;
695+
696+
@Parameter( defaultValue = "${project.testClasspathElements}", readonly = true )
697+
private List<String> testClassPath;
698+
699+
@Parameter( defaultValue = "${mojoExecution}", readonly = true, required = true )
700+
private MojoExecution mojoExecution;
701+
702+
@Parameter( defaultValue = "${project}", readonly = true, required = true )
703+
private MavenProject project;
704+
705+
@Parameter( defaultValue = "${session}", readonly = true, required = true )
706+
private MavenSession session;
707+
708+
@Parameter( defaultValue = "${settings}", readonly = true, required = true )
709+
private Settings settings;
710+
711+
@Component
712+
private Invoker invoker;
713+
714+
@Component
715+
private SettingsBuilder settingsBuilder;
716+
717+
@Component
718+
private ToolchainManagerPrivate toolchainManagerPrivate;
719+
706720
/**
707721
* Invokes Maven on the configured test projects.
708722
*

0 commit comments

Comments
 (0)