Author: tchemit Date: Wed Jul 11 17:47:50 2012 New Revision: 1360317 URL: http://svn.apache.org/viewvc?rev=1360317&view=rev Log: [MPH-89] use maven-plugin-tools' java 5 annotations
Modified: maven/plugins/trunk/maven-help-plugin/pom.xml maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectiveSettingsMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EvaluateMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ExpressionsMojo.java maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java Modified: maven/plugins/trunk/maven-help-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/pom.xml?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-help-plugin/pom.xml Wed Jul 11 17:47:50 2012 @@ -25,7 +25,7 @@ under the License. <parent> <artifactId>maven-plugins</artifactId> <groupId>org.apache.maven.plugins</groupId> - <version>21</version> + <version>22</version> <relativePath>../maven-plugins/pom.xml</relativePath> </parent> @@ -119,6 +119,11 @@ under the License. <artifactId>maven-plugin-tools-api</artifactId> <version>2.4.3</version> </dependency> + <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + <version>3.1</version> + </dependency> <!-- plexus --> <dependency> @@ -182,8 +187,31 @@ under the License. </dependencies> <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <version>3.1</version> + <configuration> + <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> + <helpPackageName>org.apache.maven.plugins.help</helpPackageName> + </configuration> + </plugin> + </plugins> + </pluginManagement> <plugins> <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <executions> + <execution> + <id>generate-descriptor</id> + <goals> + <goal>descriptor</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-component-metadata</artifactId> <executions> Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java Wed Jul 11 17:47:50 2012 @@ -19,14 +19,15 @@ package org.apache.maven.plugins.help; * under the License. */ -import java.io.File; -import java.io.IOException; -import java.io.Writer; - import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugins.annotations.Parameter; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.WriterFactory; +import java.io.File; +import java.io.IOException; +import java.io.Writer; + /** * Base class with some Help Mojo functionalities. * @@ -44,9 +45,8 @@ public abstract class AbstractHelpMojo * Optional parameter to write the output of this help in a given file, instead of writing to the console. * <br/> * <b>Note</b>: Could be a relative path. - * - * @parameter expression="${output}" */ + @Parameter( property = "output" ) protected File output; /** Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ActiveProfilesMojo.java Wed Jul 11 17:47:50 2012 @@ -19,24 +19,25 @@ package org.apache.maven.plugins.help; * under the License. */ +import org.apache.maven.model.Profile; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; + import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; -import org.apache.maven.model.Profile; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.project.MavenProject; - /** * Displays a list of the profiles which are currently active for this build. * * @version $Id$ * @since 2.0 - * @goal active-profiles - * @aggregator */ +@Mojo( name = "active-profiles", aggregator = true ) public class ActiveProfilesMojo extends AbstractHelpMojo { @@ -46,11 +47,8 @@ public class ActiveProfilesMojo /** * This is the list of projects currently slated to be built by Maven. - * - * @parameter expression="${reactorProjects}" - * @required - * @readonly */ + @Parameter( property = "reactorProjects", required = true, readonly = true ) private List projects; // ---------------------------------------------------------------------- Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java Wed Jul 11 17:47:50 2012 @@ -19,16 +19,13 @@ package org.apache.maven.plugins.help; * under the License. */ -import java.io.File; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Profile; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.profiles.DefaultMavenProfilesBuilder; import org.apache.maven.profiles.DefaultProfileManager; import org.apache.maven.profiles.ProfileManager; @@ -40,6 +37,12 @@ import org.apache.maven.settings.Setting import org.apache.maven.settings.SettingsUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import java.io.File; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + /** * Displays a list of available profiles under the current project. * <br/> @@ -50,9 +53,8 @@ import org.codehaus.plexus.util.xml.pull * @author <a href="mailto:rahul.thakur.x...@gmail.com">Rahul Thakur</a> * @version $Id$ * @since 2.1 - * @goal all-profiles - * @requiresProject false */ +@Mojo( name = "all-profiles", requiresProject = false ) public class AllProfilesMojo extends AbstractHelpMojo { @@ -62,20 +64,14 @@ public class AllProfilesMojo /** * This is the list of projects currently slated to be built by Maven. - * - * @parameter expression="${reactorProjects}" - * @required - * @readonly */ + @Parameter( property = "reactorProjects", required = true, readonly = true ) private List projects; /** * The current build session instance. This is used for plugin manager API calls. - * - * @parameter expression="${session}" - * @required - * @readonly */ + @Component private MavenSession session; // ---------------------------------------------------------------------- Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java Wed Jul 11 17:47:50 2012 @@ -54,6 +54,8 @@ import org.apache.maven.plugin.descripto import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugin.version.PluginVersionNotFoundException; import org.apache.maven.plugin.version.PluginVersionResolutionException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectBuilder; import org.apache.maven.project.ProjectBuildingException; @@ -67,24 +69,30 @@ import org.codehaus.plexus.util.StringUt * * @version $Id$ * @since 2.0 - * @goal describe - * @requiresProject false - * @aggregator * @see <a href="http://maven.apache.org/general.html#What_is_a_Mojo">What is a Mojo?</a> */ +@Mojo( name = "describe", requiresProject = false, aggregator = true ) public class DescribeMojo extends AbstractHelpMojo { - /** The default indent size when writing description's Mojo. */ + /** + * The default indent size when writing description's Mojo. + */ private static final int INDENT_SIZE = 2; - /** For unknown values */ + /** + * For unknown values + */ private static final String UNKNOWN = "Unknown"; - /** For not defined values */ + /** + * For not defined values + */ private static final String NOT_DEFINED = "Not defined"; - /** For deprecated values */ + /** + * For deprecated values + */ private static final String NO_REASON = "No reason given"; // ---------------------------------------------------------------------- @@ -94,25 +102,23 @@ public class DescribeMojo /** * Maven Artifact Factory component. * - * @component * @since 2.1 */ + @Component private ArtifactFactory artifactFactory; /** * The Plugin manager instance used to resolve Plugin descriptors. - * - * @component role="org.apache.maven.plugin.PluginManager" */ + @Component( role = PluginManager.class ) private PluginManager pluginManager; /** * The project builder instance used to retrieve the super-project instance * in the event there is no current MavenProject instance. Some MavenProject * instance has to be present to use in the plugin manager APIs. - * - * @component role="org.apache.maven.project.MavenProjectBuilder" */ + @Component( role = MavenProjectBuilder.class ) private MavenProjectBuilder projectBuilder; // ---------------------------------------------------------------------- @@ -124,50 +130,38 @@ public class DescribeMojo * the help plugin should be able to function on its own. If this * parameter is empty at execution time, this Mojo will instead use the * super-project. - * - * @parameter expression="${project}" - * @readonly */ + @Component private MavenProject project; /** * The current user system settings for use in Maven. This is used for * plugin manager API calls. - * - * @parameter expression="${settings}" - * @required - * @readonly */ + @Component private Settings settings; /** * The current build session instance. This is used for * plugin manager API calls. - * - * @parameter expression="${session}" - * @required - * @readonly */ + @Component private MavenSession session; /** * The local repository ArtifactRepository instance. This is used * for plugin manager API calls. - * - * @parameter expression="${localRepository}" - * @required - * @readonly */ + @org.apache.maven.plugins.annotations.Parameter( property = "localRepository", required = true, readonly = true ) private ArtifactRepository localRepository; /** * Remote repositories used for the project. * * @since 2.1 - * @parameter expression="${project.remoteArtifactRepositories}" - * @required - * @readonly */ + @org.apache.maven.plugins.annotations.Parameter( property = "project.remoteArtifactRepositories", required = true, + readonly = true ) private List remoteRepositories; /** @@ -178,36 +172,32 @@ public class DescribeMojo * <li>groupId:artifactId, i.e. 'org.apache.maven.plugins:maven-help-plugin'</li> * <li>groupId:artifactId:version, i.e. 'org.apache.maven.plugins:maven-help-plugin:2.0'</li> * </ol> - * - * @parameter expression="${plugin}" alias="prefix" */ + @org.apache.maven.plugins.annotations.Parameter( property = "plugin", alias = "prefix" ) private String plugin; /** * The Maven Plugin <code>groupId</code> to describe. * <br/> * <b>Note</b>: Should be used with <code>artifactId</code> parameter. - * - * @parameter expression="${groupId}" */ + @org.apache.maven.plugins.annotations.Parameter( property = "groupId" ) private String groupId; /** * The Maven Plugin <code>artifactId</code> to describe. * <br/> * <b>Note</b>: Should be used with <code>groupId</code> parameter. - * - * @parameter expression="${artifactId}" */ + @org.apache.maven.plugins.annotations.Parameter( property = "artifactId" ) private String artifactId; /** * The Maven Plugin <code>version</code> to describe. * <br/> * <b>Note</b>: Should be used with <code>groupId/artifactId</code> parameters. - * - * @parameter expression="${version}" */ + @org.apache.maven.plugins.annotations.Parameter( property = "version" ) private String version; /** @@ -215,33 +205,33 @@ public class DescribeMojo * If this parameter is specified, only the corresponding goal (Mojo) will be described, * rather than the whole Plugin. * - * @parameter expression="${goal}" alias="mojo" * @since 2.1, was <code>mojo</code> in 2.0.x */ + @org.apache.maven.plugins.annotations.Parameter( property = "goal", alias = "mojo" ) private String goal; /** * This flag specifies that a detailed (verbose) list of goal (Mojo) information should be given. * - * @parameter expression="${detail}" default-value="false" alias="full" * @since 2.1, was <code>full</code> in 2.0.x */ + @org.apache.maven.plugins.annotations.Parameter( property = "detail", defaultValue = "false", alias = "full" ) private boolean detail; /** * This flag specifies that a medium list of goal (Mojo) information should be given. * - * @parameter expression="${medium}" default-value="true" * @since 2.0.2 */ + @org.apache.maven.plugins.annotations.Parameter( property = "medium", defaultValue = "true" ) private boolean medium; /** * This flag specifies that a minimal list of goal (Mojo) information should be given. * - * @parameter expression="${minimal}" default-value="false" * @since 2.1 */ + @org.apache.maven.plugins.annotations.Parameter( property = "minimal", defaultValue = "false" ) private boolean minimal; /** @@ -249,9 +239,9 @@ public class DescribeMojo * <br/> * <code>mvn [options] [<goal(s)>] [<phase(s)>]</code> * - * @parameter expression="${cmd}" * @since 2.1 */ + @org.apache.maven.plugins.annotations.Parameter( property = "cmd" ) private String cmd; // ---------------------------------------------------------------------- Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java Wed Jul 11 17:47:50 2012 @@ -19,16 +19,12 @@ package org.apache.maven.plugins.help; * under the License. */ -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.Iterator; -import java.util.List; -import java.util.Properties; - import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Writer; import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter; @@ -40,14 +36,20 @@ import org.jdom.input.SAXBuilder; import org.jdom.output.Format; import org.jdom.output.XMLOutputter; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + /** * Displays the effective POM as an XML for this build, with the active profiles factored in. * * @version $Id$ * @since 2.0 - * @goal effective-pom - * @aggregator */ +@Mojo( name = "effective-pom", aggregator = true ) public class EffectivePomMojo extends AbstractEffectiveMojo { @@ -59,20 +61,15 @@ public class EffectivePomMojo * The Maven project. * * @since 2.0.2 - * @parameter expression="${project}" - * @required - * @readonly */ + @Component private MavenProject project; /** * The projects in the current build. The effective-POM for * each of these projects will written. - * - * @parameter expression="${reactorProjects}" - * @required - * @readonly */ + @Parameter( property = "reactorProjects", required = true, readonly = true ) private List projects; // ---------------------------------------------------------------------- Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectiveSettingsMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectiveSettingsMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectiveSettingsMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectiveSettingsMojo.java Wed Jul 11 17:47:50 2012 @@ -19,14 +19,10 @@ package org.apache.maven.plugins.help; * under the License. */ -import java.io.IOException; -import java.io.StringWriter; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Iterator; -import java.util.Properties; - import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.settings.Profile; import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Server; @@ -37,15 +33,21 @@ import org.codehaus.plexus.util.xml.Pret import org.codehaus.plexus.util.xml.XMLWriter; import org.codehaus.plexus.util.xml.XmlWriterUtil; +import java.io.IOException; +import java.io.StringWriter; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Iterator; +import java.util.Properties; + /** * Displays the calculated settings as XML for this project, given any profile enhancement and the inheritance * of the global settings into the user-level settings. * * @version $Id$ * @since 2.0 - * @goal effective-settings - * @requiresProject false */ +@Mojo( name = "effective-settings", requiresProject = false ) public class EffectiveSettingsMojo extends AbstractEffectiveMojo { @@ -56,19 +58,16 @@ public class EffectiveSettingsMojo /** * The system settings for Maven. This is the instance resulting from * merging global and user-level settings files. - * - * @parameter expression="${settings}" - * @readonly - * @required */ + @Component private Settings settings; /** * For security reasons, all passwords are hidden by default. Set this to <code>true</code> to show all passwords. * * @since 2.1 - * @parameter expression="${showPasswords}" default-value="false" */ + @Parameter(property = "showPasswords", defaultValue = "false") private boolean showPasswords; // ---------------------------------------------------------------------- Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EvaluateMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EvaluateMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EvaluateMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EvaluateMojo.java Wed Jul 11 17:47:50 2012 @@ -19,20 +19,10 @@ package org.apache.maven.plugins.help; * under the License. */ -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; -import java.util.TreeMap; -import java.util.jar.JarEntry; -import java.util.jar.JarInputStream; - +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.converters.MarshallingContext; +import com.thoughtworks.xstream.converters.collections.PropertiesConverter; +import com.thoughtworks.xstream.io.HierarchicalStreamWriter; import org.apache.commons.lang.ClassUtils; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.ArtifactUtils; @@ -51,6 +41,9 @@ import org.apache.maven.plugin.MojoExecu import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.PluginParameterExpressionEvaluator; import org.apache.maven.plugin.descriptor.MojoDescriptor; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectBuilder; import org.apache.maven.project.ProjectBuildingException; @@ -62,10 +55,19 @@ import org.codehaus.plexus.components.in import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.converters.MarshallingContext; -import com.thoughtworks.xstream.converters.collections.PropertiesConverter; -import com.thoughtworks.xstream.io.HierarchicalStreamWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.TreeMap; +import java.util.jar.JarEntry; +import java.util.jar.JarInputStream; /** * Evaluates Maven expressions given by the user in an interactive mode. @@ -73,9 +75,8 @@ import com.thoughtworks.xstream.io.Hiera * @author <a href="mailto:vincent.sive...@gmail.com">Vincent Siveton</a> * @version $Id$ * @since 2.1 - * @goal evaluate - * @requiresProject false */ +@Mojo( name = "evaluate", requiresProject = false ) public class EvaluateMojo extends AbstractMojo { @@ -85,40 +86,36 @@ public class EvaluateMojo /** * Maven Artifact Factory component. - * - * @component */ + @Component private ArtifactFactory artifactFactory; /** * Input handler, needed for command line handling. - * - * @component */ + @Component private InputHandler inputHandler; /** * Maven Project Builder component. - * - * @component */ + @Component private MavenProjectBuilder mavenProjectBuilder; /** - * @component */ + @Component private PathTranslator pathTranslator; /** * Artifact Resolver component. - * - * @component */ + @Component private ArtifactResolver resolver; /** - * @component */ + @Component private LoggerRetriever loggerRetriever; // ---------------------------------------------------------------------- @@ -129,61 +126,44 @@ public class EvaluateMojo * An artifact for evaluating Maven expressions. * <br/> * <b>Note</b>: Should respect the Maven format, i.e. <code>groupId:artifactId[:version][:classifier]</code>. - * - * @parameter expression="${artifact}" */ + @Parameter( property = "artifact" ) private String artifact; /** * An expression to evaluate instead of prompting. Note that this <i>must not</i> include the surrounding ${...}. - * - * @parameter expression="${expression}" */ + @Parameter( property = "expression" ) private String expression; /** * Local Repository. - * - * @parameter expression="${localRepository}" - * @required - * @readonly */ + @Parameter( property = "localRepository", required = true, readonly = true ) protected ArtifactRepository localRepository; /** * The current Maven project or the super pom. - * - * @parameter expression="${project}" - * @readonly - * @required */ + @Component protected MavenProject project; /** * Remote repositories used for the project. - * - * @parameter expression="${project.remoteArtifactRepositories}" - * @readonly - * @required */ + @Parameter( property = "project.remoteArtifactRepositories", required = true, readonly = true ) private List remoteRepositories; /** * The system settings for Maven. - * - * @parameter expression="${settings}" - * @readonly - * @required */ + @Component protected Settings settings; /** * The current Maven session. - * - * @parameter expression="${session}" - * @required - * @readonly */ + @Component private MavenSession session; // ---------------------------------------------------------------------- Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ExpressionsMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ExpressionsMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ExpressionsMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/ExpressionsMojo.java Wed Jul 11 17:47:50 2012 @@ -19,29 +19,29 @@ package org.apache.maven.plugins.help; * under the License. */ -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.usability.plugin.Expression; import org.apache.maven.usability.plugin.ExpressionDocumentationException; import org.apache.maven.usability.plugin.ExpressionDocumenter; import org.codehaus.plexus.util.StringUtils; +import java.io.IOException; +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + /** * Displays the supported Plugin expressions used by Maven. * * @author <a href="mailto:vincent.sive...@gmail.com">Vincent Siveton</a> * @version $Id$ * @since 2.1 - * @goal expressions - * @requiresProject false */ +@Mojo( name = "expressions", requiresProject = false ) public class ExpressionsMojo extends AbstractHelpMojo { Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java?rev=1360317&r1=1360316&r2=1360317&view=diff ============================================================================== --- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java (original) +++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java Wed Jul 11 17:47:50 2012 @@ -19,24 +19,24 @@ package org.apache.maven.plugins.help; * under the License. */ +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.Mojo; +import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.cli.CommandLineUtils; + import java.io.IOException; import java.util.Date; import java.util.Iterator; import java.util.Properties; -import org.apache.maven.plugin.MojoExecutionException; -import org.codehaus.plexus.util.StringUtils; -import org.codehaus.plexus.util.cli.CommandLineUtils; - /** * Displays a list of the platform details like system properties and environment variables. * * @author <a href="mailto:vincent.sive...@gmail.com">Vincent Siveton</a> * @version $Id$ * @since 2.1 - * @goal system - * @requiresProject false */ +@Mojo( name = "system", requiresProject = false ) public class SystemMojo extends AbstractHelpMojo {