diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java b/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java index 70ecea5..4b0156a 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java @@ -21,6 +21,7 @@ package org.apache.maven.plugin.coreit; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.DependencyScope; import org.apache.maven.plugins.annotations.Execute; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; @@ -33,7 +34,7 @@ import org.apache.maven.tools.plugin.annotations.FooMojo; * @since 1.2 * @deprecated Don't use! */ -@Mojo( name = "first", requiresDependencyResolution = "test", defaultPhase = LifecyclePhase.INTEGRATION_TEST ) +@Mojo( name = "first", requiresDependencyResolution = DependencyScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST ) public class FirstMojo extends FooMojo { @@ -51,11 +52,11 @@ public class FirstMojo public void execute() throws MojoExecutionException { - if (bar == null) + if ( bar == null ) { throw new MojoExecutionException( "bar == null" ); } - if (beer == null) + if ( beer == null ) { throw new MojoExecutionException( "beer == null" ); } diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-abstract-mojo/src/main/java/org/apache/maven/plugins/AbstractFirstMojo.java b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-abstract-mojo/src/main/java/org/apache/maven/plugins/AbstractFirstMojo.java index bfc8a4e..8cd2e64 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-abstract-mojo/src/main/java/org/apache/maven/plugins/AbstractFirstMojo.java +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-abstract-mojo/src/main/java/org/apache/maven/plugins/AbstractFirstMojo.java @@ -58,7 +58,7 @@ public abstract class AbstractFirstMojo /** * */ - @Component(role = "org.apache.maven.artifact.metadata.ArtifactMetadataSource", roleHint = "maven") + @Component( role = "org.apache.maven.artifact.metadata.ArtifactMetadataSource", roleHint = "maven" ) protected ArtifactMetadataSource artifactMetadataSource; diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java index b6dc2fa..55be47c 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java @@ -31,12 +31,12 @@ import java.io.IOException; * Touches a test file. * */ -@Mojo( name = "it0014") +@Mojo( name = "it0014" ) public class CoreIt0014Mojo extends AbstractMojo { - @Parameter(expression ="${project.build.directory}", required = true) + @Parameter( expression = "${project.build.directory}", required = true ) private String outputDirectory; public void execute() diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java index a70cc1f..5618dd1 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java @@ -21,6 +21,7 @@ package org.apache.maven.plugin.coreit; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.DependencyScope; import org.apache.maven.plugins.annotations.Execute; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; @@ -33,7 +34,7 @@ import org.apache.maven.plugins.AbstractFirstMojo; * @since 1.2 * @deprecated Don't use! */ -@Mojo( name = "first", requiresDependencyResolution = "test", defaultPhase = LifecyclePhase.INTEGRATION_TEST ) +@Mojo( name = "first", requiresDependencyResolution = DependencyScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST ) @Execute( phase = LifecyclePhase.GENERATE_SOURCES, lifecycle = "cobertura" ) public class FirstMojo extends AbstractFirstMojo @@ -46,17 +47,17 @@ public class FirstMojo @Parameter( alias = "alias" ) private String aliasedParam; - @Component( role = "org.apache.maven.project.MavenProjectHelper") + @Component( role = "org.apache.maven.project.MavenProjectHelper" ) private Object projectHelper; public void execute() throws MojoExecutionException { - if (basedir == null) + if ( basedir == null ) { throw new MojoExecutionException( "basedir == null" ); } - if (touchFile == null) + if ( touchFile == null ) { throw new MojoExecutionException( "touchFile == null" ); } diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java index 8e28eba..47552b2 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/module-mojo/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java @@ -20,13 +20,14 @@ package org.apache.maven.plugin.coreit; */ import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugins.annotations.DependencyScope; import org.apache.maven.plugins.annotations.Mojo; /** * Does nothing special. * */ -@Mojo( name = "second",requiresDependencyCollection = "compile", threadSafe = true) +@Mojo( name = "second", requiresDependencyCollection = DependencyScope.COMPILE, threadSafe = true ) public class SecondMojo extends AbstractMojo { diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java b/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java index b6dc2fa..55be47c 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java @@ -31,12 +31,12 @@ import java.io.IOException; * Touches a test file. * */ -@Mojo( name = "it0014") +@Mojo( name = "it0014" ) public class CoreIt0014Mojo extends AbstractMojo { - @Parameter(expression ="${project.build.directory}", required = true) + @Parameter( expression = "${project.build.directory}", required = true ) private String outputDirectory; public void execute() diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java b/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java index adcb5e3..2f143b3 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java @@ -21,6 +21,7 @@ package org.apache.maven.plugin.coreit; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.DependencyScope; import org.apache.maven.plugins.annotations.Execute; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; @@ -32,7 +33,7 @@ import org.apache.maven.plugins.annotations.Parameter; * @since 1.2 * @deprecated Don't use! */ -@Mojo( name = "first", requiresDependencyResolution = "test", defaultPhase = LifecyclePhase.INTEGRATION_TEST) +@Mojo( name = "first", requiresDependencyResolution = DependencyScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST ) @Execute( phase = LifecyclePhase.GENERATE_SOURCES, lifecycle = "cobertura" ) public class FirstMojo extends AbstractFirstMojo diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java b/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java index 8e28eba..47552b2 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java @@ -20,13 +20,14 @@ package org.apache.maven.plugin.coreit; */ import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugins.annotations.DependencyScope; import org.apache.maven.plugins.annotations.Mojo; /** * Does nothing special. * */ -@Mojo( name = "second",requiresDependencyCollection = "compile", threadSafe = true) +@Mojo( name = "second", requiresDependencyCollection = DependencyScope.COMPILE, threadSafe = true ) public class SecondMojo extends AbstractMojo { diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy b/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy index 8554b25..bd7c3cf 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy @@ -12,7 +12,7 @@ assert newHelpClass.exists() def pluginDescriptor = new XmlParser().parse( descriptorFile ); -def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first"}[0] +def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first" }[0] assert mojo.goal.text() == 'first' assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.FirstMojo' diff --git a/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java b/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java index b6dc2fa..55be47c 100644 --- a/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java +++ b/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/CoreIt0014Mojo.java @@ -31,12 +31,12 @@ import java.io.IOException; * Touches a test file. * */ -@Mojo( name = "it0014") +@Mojo( name = "it0014" ) public class CoreIt0014Mojo extends AbstractMojo { - @Parameter(expression ="${project.build.directory}", required = true) + @Parameter( expression = "${project.build.directory}", required = true ) private String outputDirectory; public void execute() diff --git a/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java b/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java index f7c64fd..01a6104 100644 --- a/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java +++ b/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/FirstMojo.java @@ -22,6 +22,7 @@ package org.apache.maven.plugin.coreit; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.DependencyScope; import org.apache.maven.plugins.annotations.Execute; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; @@ -35,7 +36,7 @@ import java.io.File; * @since 1.2 * @deprecated Don't use! */ -@Mojo( name = "first", requiresDependencyResolution = "test", defaultPhase = LifecyclePhase.INTEGRATION_TEST ) +@Mojo( name = "first", requiresDependencyResolution = DependencyScope.TEST, defaultPhase = LifecyclePhase.INTEGRATION_TEST ) @Execute( phase = LifecyclePhase.GENERATE_SOURCES, lifecycle = "cobertura" ) public class FirstMojo extends AbstractMojo diff --git a/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java b/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java index 8e28eba..47552b2 100644 --- a/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java +++ b/maven-plugin-plugin/src/it/java-basic-annotations/src/main/java/org/apache/maven/plugin/coreit/SecondMojo.java @@ -20,13 +20,14 @@ package org.apache.maven.plugin.coreit; */ import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugins.annotations.DependencyScope; import org.apache.maven.plugins.annotations.Mojo; /** * Does nothing special. * */ -@Mojo( name = "second",requiresDependencyCollection = "compile", threadSafe = true) +@Mojo( name = "second", requiresDependencyCollection = DependencyScope.COMPILE, threadSafe = true ) public class SecondMojo extends AbstractMojo { diff --git a/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy b/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy index ef33aa5..e341a9a 100644 --- a/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy +++ b/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy @@ -6,7 +6,7 @@ assert descriptorFile.isFile() def pluginDescriptor = new XmlParser().parse( descriptorFile ); -def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first"}[0] +def mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "first" }[0] assert mojo.goal.text() == 'first' assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.FirstMojo' @@ -40,7 +40,7 @@ assert mojo.requirements.requirement[0].'field-name'.text() == 'projectHelper' assert mojo.parameters.parameter.size() == 3 -def parameter = mojo.parameters.parameter.findAll{ it.name.text() == "aliasedParam"}[0] +def parameter = mojo.parameters.parameter.findAll{ it.name.text() == "aliasedParam" }[0] assert parameter.name.text() == 'aliasedParam' assert parameter.alias.text() == 'alias' @@ -50,7 +50,7 @@ assert parameter.required.text() == 'false' assert parameter.editable.text() == 'true' assert parameter.description.text() == '' -parameter = mojo.parameters.parameter.findAll{ it.name.text() == "touchFile"}[0] +parameter = mojo.parameters.parameter.findAll{ it.name.text() == "touchFile" }[0] assert parameter.name.text() == 'touchFile' assert parameter.alias.isEmpty() @@ -60,7 +60,7 @@ assert parameter.required.text() == 'true' assert parameter.editable.text() == 'true' assert parameter.description.text() == '' -parameter = mojo.parameters.parameter.findAll{ it.name.text() == "basedir"}[0] +parameter = mojo.parameters.parameter.findAll{ it.name.text() == "basedir" }[0] assert parameter.name.text() == 'basedir' assert parameter.alias.isEmpty() @@ -70,7 +70,7 @@ assert parameter.required.text() == 'false' assert parameter.editable.text() == 'false' assert parameter.description.text() == 'Project directory.' -mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "second"}[0] +mojo = pluginDescriptor.mojos.mojo.findAll{ it.goal.text() == "second" }[0] assert mojo.requiresDependencyCollection.text() == 'compile' assert mojo.threadSafe.text() == 'true' diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java index 44044e7..db9719f 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java @@ -82,9 +82,9 @@ public class MojoAnnotationContent return requiresDependencyResolution; } - public void requiresDependencyResolution( DependencyScope requiresDependencyResolution ) + public void requiresDependencyResolution( String requiresDependencyResolution ) { - this.requiresDependencyResolution = requiresDependencyResolution; + this.requiresDependencyResolution = DependencyScope.valueOf( requiresDependencyResolution ); } public DependencyScope requiresDependencyCollection() @@ -92,9 +92,9 @@ public class MojoAnnotationContent return requiresDependencyCollection; } - public void requiresDependencyCollection( DependencyScope requiresDependencyCollection ) + public void requiresDependencyCollection( String requiresDependencyCollection ) { - this.requiresDependencyCollection = requiresDependencyCollection; + this.requiresDependencyCollection = DependencyScope.valueOf( requiresDependencyCollection ); } public InstanciationStrategy instantiationStrategy() @@ -102,9 +102,9 @@ public class MojoAnnotationContent return instantiationStrategy; } - public void instantiationStrategy( InstanciationStrategy instantiationStrategy ) + public void instantiationStrategy( String instantiationStrategy ) { - this.instantiationStrategy = instantiationStrategy; + this.instantiationStrategy = InstanciationStrategy.valueOf( instantiationStrategy ); } public String executionStrategy()