Author: tchemit Date: Tue Jul 10 16:43:50 2012 New Revision: 1359773 URL: http://svn.apache.org/viewvc?rev=1359773&view=rev Log: [MASSEMBLY-618] use maven-plugin-tools' java 5 annotations
Modified: maven/plugins/trunk/maven-assembly-plugin/pom.xml maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AssemblyMojo.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AttachedAssemblyMojo.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryInlineMojo.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryMojo.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectorySingleMojo.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/SingleAssemblyMojo.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/UnpackMojo.java Modified: maven/plugins/trunk/maven-assembly-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/pom.xml?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-assembly-plugin/pom.xml Tue Jul 10 16:43:50 2012 @@ -90,6 +90,13 @@ under the License. <version>1.4</version> </dependency> <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + <version>3.1</version> + <scope>compile</scope> + </dependency> + + <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-interpolation</artifactId> <version>1.15</version> @@ -260,11 +267,31 @@ under the License. </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <executions> + <execution> + <id>mojo-descriptor</id> + <goals> + <goal>descriptor</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>3.1</version> + <configuration> + <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <excludes> Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractAssemblyMojo.java Tue Jul 10 16:43:50 2012 @@ -35,6 +35,8 @@ import org.apache.maven.plugin.assembly. import org.apache.maven.plugin.assembly.model.Assembly; import org.apache.maven.plugin.assembly.utils.AssemblyFormatUtils; import org.apache.maven.plugin.logging.Log; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; import org.apache.maven.shared.filtering.MavenFileFilter; @@ -55,92 +57,72 @@ public abstract class AbstractAssemblyMo extends AbstractMojo implements AssemblerConfigurationSource { - /** + /** * The character encoding scheme to be applied when filtering resources. - * - * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}" */ + @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" ) protected String encoding; /** * Flag allowing one or more executions of the assembly plugin to be configured as skipped for a particular build. * This makes the assembly plugin more controllable from profiles. - * - * @parameter expression="${assembly.skipAssembly}" default-value="false" */ + @Parameter( property = "assembly.skipAssembly", defaultValue = "false" ) private boolean skipAssembly; /** * If this flag is set, everything up to the call to Archiver.createArchive() will be executed. - * - * @parameter expression="${assembly.dryRun}" default-value="false" */ + @Parameter( property = "assembly.dryRun", defaultValue = "false" ) private boolean dryRun; /** * If this flag is set, the ".dir" suffix will be suppressed in the output directory name when using assembly/format * == 'dir' and other formats that begin with 'dir'. <br/> * <b>NOTE:</b> Since 2.2-beta-3, the default-value for this is true, NOT false as it used to be. - * - * @parameter default-value="true" */ + @Parameter( defaultValue = "true" ) private boolean ignoreDirFormatExtensions; /** * Local Maven repository where artifacts are cached during the build process. - * - * @parameter default-value="${localRepository}" - * @required - * @readonly */ + @Parameter( defaultValue = "${localRepository}", required = true, readonly = true ) private ArtifactRepository localRepository; /** - * @parameter default-value="${project.remoteArtifactRepositories}" - * @required - * @readonly */ + @Parameter( defaultValue = "${project.remoteArtifactRepositories}", required = true, readonly = true ) private List<ArtifactRepository> remoteRepositories; /** * Contains the full list of projects in the reactor. - * - * @parameter default-value="${reactorProjects}" - * @required - * @readonly */ + @Parameter( defaultValue = "${reactorProjects}", required = true, readonly = true ) private List<MavenProject> reactorProjects; /** * The output directory of the assembled distribution file. - * - * @parameter default-value="${project.build.directory}" - * @required */ + @Parameter( defaultValue = "${project.build.directory}", required = true ) private File outputDirectory; /** * The filename of the assembled distribution file. - * - * @parameter default-value="${project.build.finalName}" - * @required */ + @Parameter( defaultValue = "${project.build.finalName}", required = true ) private String finalName; /** * Directory to unpack JARs into if needed - * - * @parameter default-value="${project.build.directory}/assembly/work" - * @required */ + @Parameter( defaultValue = "${project.build.directory}/assembly/work", required = true ) private File workDirectory; - + /** - * @parameter - * - * Specifies the formats of the assembly. - * Multiple formats can be supplied and the Assembly Plugin will generate an archive for each desired formats. - * When deploying your project, all file formats specified will also be deployed. A format is specified by supplying one of the following + * Specifies the formats of the assembly. + * Multiple formats can be supplied and the Assembly Plugin will generate an archive for each desired formats. + * When deploying your project, all file formats specified will also be deployed. A format is specified by supplying one of the following * values in a <format> subelement: * <ul> * <li><em>zip</em> - Creates a ZIP file format</li> @@ -149,156 +131,136 @@ public abstract class AbstractAssemblyMo * <li><em>tar.bz2</em> - Creates a bzip'd TAR format</li> * </ul> */ + @Parameter private List<String> formats; /** * This is the artifact classifier to be used for the resultant assembly artifact. Normally, you would use the * assembly-id instead of specifying this here. - * - * @parameter expression="${classifier}" + * * @deprecated Please use the Assembly's id for classifier instead */ @Deprecated @SuppressWarnings( "unused" ) + @Parameter( property = "classifier" ) private String classifier; /** * A list of descriptor files to generate from. - * - * @parameter */ + @Parameter private String[] descriptors; /** * A list of references to assembly descriptors available on the plugin's classpath. The default classpath * includes these built-in descriptors: <code>bin</code>, - * <code>jar-with-dependencies</code>, <code>src</code>, and + * <code>jar-with-dependencies</code>, <code>src</code>, and * <code>project</code>. You can add others by adding dependencies * to the plugin. - * - * @parameter */ + @Parameter private String[] descriptorRefs; /** * Directory to scan for descriptor files in. <b>NOTE:</b> This may not work correctly with assembly components. - * - * @parameter */ + @Parameter private File descriptorSourceDirectory; /** * This is the base directory from which archive files are created. This base directory pre-pended to any * <code><directory></code> specifications in the assembly descriptor. This is an optional parameter. - * - * @parameter */ + @Parameter private File archiveBaseDirectory; /** * Predefined Assembly Descriptor Id's. You can select bin, jar-with-dependencies, or src. - * - * @parameter expression="${descriptorId}" + * * @deprecated Please use descriptorRefs instead */ @Deprecated + @Parameter( property = "descriptorId" ) protected String descriptorId; /** * Assembly XML Descriptor file. This must be the path to your customized descriptor file. - * - * @parameter expression="${descriptor}" + * * @deprecated Please use descriptors instead */ @Deprecated + @Parameter( property = "descriptor" ) protected String descriptor; /** * Sets the TarArchiver behavior on file paths with more than 100 characters length. Valid values are: "warn" * (default), "fail", "truncate", "gnu", or "omit". - * - * @parameter expression="${assembly.tarLongFileMode}" default-value="warn" */ + @Parameter( property = "assembly.tarLongFileMode", defaultValue = "warn" ) private String tarLongFileMode; /** * Base directory of the project. - * - * @parameter default-value="${project.basedir}" - * @required - * @readonly */ + @Parameter( defaultValue = "${project.basedir}", required = true, readonly = true ) private File basedir; /** * Maven ProjectHelper. - * - * @component */ + @Component private MavenProjectHelper projectHelper; /** * Maven shared filtering utility. - * - * @component */ + @Component private MavenFileFilter mavenFileFilter; /** * The Maven Session Object - * - * @parameter default-value="${session}" - * @required - * @readonly */ + @Component private MavenSession mavenSession; /** * Temporary directory that contain the files to be assembled. - * - * @parameter default-value="${project.build.directory}/archive-tmp" - * @required - * @readonly */ + @Parameter( defaultValue = "${project.build.directory}/archive-tmp", required = true, readonly = true ) private File tempRoot; /** * Directory for site generated. - * - * @parameter default-value="${project.reporting.outputDirectory}" - * @readonly */ + @Parameter( defaultValue = "${project.reporting.outputDirectory}", readonly = true ) private File siteDirectory; /** * Set to true to include the site generated by site:site goal. - * - * @parameter expression="${includeSite}" default-value="false" + * * @deprecated Please set this variable in the assembly descriptor instead */ @Deprecated + @Parameter( property = "includeSite", defaultValue = "false" ) private boolean includeSite; /** * Set to false to exclude the assembly id from the assembly final name. - * - * @parameter expression="${assembly.appendAssemblyId}" default-value="true" */ + @Parameter( property = "assembly.appendAssemblyId", defaultValue = "true" ) protected boolean appendAssemblyId; /** * Set to true in order to not fail when a descriptor is missing. - * - * @parameter expression="${assembly.ignoreMissingDescriptor}" default-value="false" */ + @Parameter( property = "assembly.ignoreMissingDescriptor", defaultValue = "false" ) protected boolean ignoreMissingDescriptor; /** * This is a set of instructions to the archive builder, especially for building .jar files. It enables you to * specify a Manifest file for the jar, in addition to other options. - * - * @parameter */ + @Parameter private MavenArchiveConfiguration archive; /** @@ -308,27 +270,26 @@ public abstract class AbstractAssemblyMo * <br/> * Normally, these will be configured from a plugin's execution section, to provide a different * set of filters for a particular execution. - * - * @parameter */ + @Parameter protected List<String> filters; /** * Controls whether the assembly plugin tries to attach the resulting assembly to the project. - * - * @parameter expression="${assembly.attach}" default-value="true" + * * @since 2.2-beta-1 */ + @Parameter( property = "assembly.attach", defaultValue = "true" ) private boolean attach; /** - * @component */ + @Component private AssemblyArchiver assemblyArchiver; /** - * @component */ + @Component private AssemblyReader assemblyReader; /** @@ -337,56 +298,56 @@ public abstract class AbstractAssemblyMo * instance. <br/> * For instance, to direct an assembly with the "ear" format to use a particular deployment descriptor, you should * specify the following for the archiverConfig value in your plugin configuration: <br/> - * + * <p/> * <pre> * <appxml>${project.basedir}/somepath/app.xml</appxml> * </pre> - * - * @parameter + * * @since 2.2-beta-3 */ + @Parameter private PlexusConfiguration archiverConfig; /** * This will cause the assembly to run only at the top of a given module tree. That is, run in the project contained * in the same folder where the mvn execution was launched. - * - * @parameter expression="${assembly.runOnlyAtExecutionRoot}" default-value="false" + * * @since 2.2-beta-4 */ + @Parameter( property = "assembly.runOnlyAtExecutionRoot", defaultValue = "false" ) private boolean runOnlyAtExecutionRoot; /** * This will cause the assembly to only update an existing archive, if it exists. - * - * @parameter expression="${assembly.updatOnly}" default-value="false" + * * @since 2.2 */ + @Parameter( property = "assembly.updatOnly", defaultValue = "false" ) private boolean updateOnly; /** * <p> * will use the jvm chmod, this is available for user and all level group level will be ignored * </p> - * - * @parameter expression="${assembly.useJvmChmod}" default-value="false" + * * @since 2.2 */ + @Parameter( property = "assembly.useJvmChmod", defaultValue = "false" ) private boolean useJvmChmod; /** * <p> * Set to <code>true</code> in order to avoid all chmod calls. * </p> - * + * <p/> * <p> * <b>NOTE:</b> This will cause the assembly plugin to <b>DISREGARD</b> all fileMode/directoryMode settings in the * assembly descriptor, and all file permissions in unpacked dependencies! * </p> - * - * @parameter expression="${assembly.ignorePermissions}" default-value="false" + * * @since 2.2 */ + @Parameter( property = "assembly.ignorePermissions", defaultValue = "false" ) private boolean ignorePermissions; /** Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AssemblyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AssemblyMojo.java?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AssemblyMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AssemblyMojo.java Tue Jul 10 16:43:50 2012 @@ -19,6 +19,10 @@ package org.apache.maven.plugin.assembly * under the License. */ +import org.apache.maven.plugins.annotations.Execute; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; /** @@ -33,21 +37,18 @@ import org.apache.maven.project.MavenPro * @author <a href="mailto:vincent.sive...@gmail.com">Vincent Siveton</a> * @version $Id$ * - * @goal assembly - * @execute phase="package" - * @aggregator - * @inheritByDefault false * @deprecated Use assembly:single instead! The assembly:assembly mojo leads to non-standard builds. */ @Deprecated +@Mojo( name = "assembly", aggregator = true, inheritByDefault = false ) +@Execute( phase = LifecyclePhase.PACKAGE ) public class AssemblyMojo extends AbstractAssemblyMojo { /** * Get the executed project from the forked lifecycle. - * - * @parameter expression="${executedProject}" */ + @Parameter( property = "executedProject" ) private MavenProject executedProject; @Override Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AttachedAssemblyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AttachedAssemblyMojo.java?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AttachedAssemblyMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AttachedAssemblyMojo.java Tue Jul 10 16:43:50 2012 @@ -19,6 +19,8 @@ package org.apache.maven.plugin.assembly * under the License. */ +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.project.MavenProject; /** @@ -32,20 +34,16 @@ import org.apache.maven.project.MavenPro * @author <a href="mailto:jer...@coffeebreaks.org">Jerome Lacoste</a> * @version $Id$ * - * @goal attached - * @aggregator - * @inheritByDefault false * @deprecated Use assembly:single instead! The assembly:attached mojo leads to non-standard builds. */ +@Mojo( name = "attached", aggregator = true, inheritByDefault = false ) @Deprecated public class AttachedAssemblyMojo extends AbstractAssemblyMojo { /** - * @parameter default-value="${project}" - * @required - * @readonly */ + @Component private MavenProject project; @Override Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryInlineMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryInlineMojo.java?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryInlineMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryInlineMojo.java Tue Jul 10 16:43:50 2012 @@ -19,6 +19,8 @@ package org.apache.maven.plugin.assembly * under the License. */ +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.project.MavenProject; /** @@ -39,21 +41,17 @@ import org.apache.maven.project.MavenPro * @author <a href="mailto:gscok...@users.sourceforge.net">Gilles Scokart</a> * @version $Id$ * - * @goal directory-inline - * @aggregator - * @inheritByDefault false * @deprecated Use assembly:single and an assembly with format == dir instead! This mojo is redundant, and leads to * non-standard builds. */ +@Mojo( name = "directory-inline", aggregator = true, inheritByDefault = false ) @Deprecated public class DirectoryInlineMojo extends AbstractDirectoryMojo { /** - * @parameter default-value="${project}" - * @required - * @readonly */ + @Component private MavenProject project; @Override Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryMojo.java?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectoryMojo.java Tue Jul 10 16:43:50 2012 @@ -19,6 +19,10 @@ package org.apache.maven.plugin.assembly * under the License. */ +import org.apache.maven.plugins.annotations.Execute; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; /** @@ -27,31 +31,28 @@ import org.apache.maven.project.MavenPro * <code>package</code> phase BEFORE the assembly is processed. This goal differs from <code>assembly:assembly</code> in * that it ignores the <formats/> section of the assembly descriptor, and forces the assembly to be created as a * directory in the project's build-output directory (usually <code>./target</code>). <br/> - * + * <p/> * This goal is also functionally equivalent to using the <code>assembly:assembly</code> goal in conjunction with the * <code>dir</code> assembly format. <br/> - * + * <p/> * <b>NOTE:</b> This goal should ONLY be run from the command line, and if building a multimodule project it should be * used from the root POM. Use the <code>assembly:directory-single</code> goal for binding your assembly to the * lifecycle. - * + * * @author <a href="mailto:jdca...@apache.org">John Casey</a> * @version $Id$ - * @goal directory - * @execute phase="package" - * @aggregator - * @inheritByDefault false * @deprecated Use assembly:single and an assembly with format == dir instead! This mojo is redundant. */ +@Mojo( name = "directory", aggregator = true, inheritByDefault = false ) +@Execute( phase = LifecyclePhase.PACKAGE ) @Deprecated public class DirectoryMojo extends AbstractDirectoryMojo { /** * Get the executed project from the forked lifecycle. - * - * @parameter expression="${executedProject}" */ + @Parameter( property = "executedProject" ) private MavenProject executedProject; @Override Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectorySingleMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectorySingleMojo.java?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectorySingleMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/DirectorySingleMojo.java Tue Jul 10 16:43:50 2012 @@ -19,6 +19,8 @@ package org.apache.maven.plugin.assembly * under the License. */ +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.project.MavenProject; /** @@ -35,19 +37,16 @@ import org.apache.maven.project.MavenPro * @author <a href="mailto:gscok...@users.sourceforge.net">Gilles Scokart</a> * @version $Id$ * - * @goal directory-single - * @inheritByDefault false * @deprecated Use assembly:single and an assembly with format == dir instead! This mojo is redundant. */ +@Mojo( name = "directory-single", inheritByDefault = false ) @Deprecated public class DirectorySingleMojo extends AbstractDirectoryMojo { /** - * @parameter default-value="${project}" - * @required - * @readonly */ + @Component private MavenProject project; @Override Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/SingleAssemblyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/SingleAssemblyMojo.java?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/SingleAssemblyMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/SingleAssemblyMojo.java Tue Jul 10 16:43:50 2012 @@ -19,28 +19,26 @@ package org.apache.maven.plugin.assembly * under the License. */ +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.project.MavenProject; /** * Assemble an application bundle or distribution from an assembly descriptor. This goal is suitable either for binding * to the lifecycle or calling directly from the command line (provided all required files are available before the * build starts, or are produced by another goal specified before this one on the command line). - * + * * @author <a href="mailto:jdca...@apache.org">John Casey</a> * @author <a href="mailto:br...@apache.org">Brett Porter</a> * @version $Id$ - * @goal single - * @inheritByDefault false - * @threadSafe */ +@Mojo( name = "single", inheritByDefault = false, threadSafe = true ) public class SingleAssemblyMojo extends AbstractAssemblyMojo { /** - * @parameter default-value="${project}" - * @required - * @readonly */ + @Component private MavenProject project; @Override Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/UnpackMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/UnpackMojo.java?rev=1359773&r1=1359772&r2=1359773&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/UnpackMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/UnpackMojo.java Tue Jul 10 16:43:50 2012 @@ -25,6 +25,10 @@ import org.apache.maven.plugin.MojoExecu import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.assembly.archive.ArchiveExpansionException; import org.apache.maven.plugin.assembly.utils.AssemblyFileUtils; +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.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.archiver.manager.ArchiverManager; import org.codehaus.plexus.archiver.manager.NoSuchArchiverException; @@ -36,41 +40,35 @@ import java.util.Set; /** * Unpack project dependencies. Currently supports dependencies of type jar and zip. - * + * * @version $Id$ - * @goal unpack - * @requiresDependencyResolution test - * @inheritByDefault false * @deprecated Use org.apache.maven.plugins:maven-dependency-plugin goal: unpack or unpack-dependencies instead. */ +@Mojo( name = "unpack", requiresDependencyResolution = ResolutionScope.TEST, inheritByDefault = false ) @Deprecated public class UnpackMojo extends AbstractMojo { /** - * @parameter default-value="${project}" - * @required - * @readonly */ + @Component private MavenProject project; /** - * @component */ + @Component private ArchiverManager archiverManager; /** * Directory to unpack JARs into if needed - * - * @parameter expression="${project.build.directory}/assembly/work" - * @required */ + @Parameter( defaultValue = "${project.build.directory}/assembly/work", required = true ) protected File workDirectory; /** * Unpacks the archive file. - * + * * @throws MojoExecutionException */ public void execute() @@ -78,8 +76,7 @@ public class UnpackMojo { final Set<Artifact> dependencies = new LinkedHashSet<Artifact>(); - if ( project.getArtifact() != null && project.getArtifact() - .getFile() != null ) + if ( project.getArtifact() != null && project.getArtifact().getFile() != null ) { dependencies.add( project.getArtifact() ); } @@ -95,8 +92,7 @@ public class UnpackMojo { final Artifact artifact = j.next(); - final String name = artifact.getFile() - .getName(); + final String name = artifact.getFile().getName(); final File tempLocation = new File( workDirectory, name.substring( 0, name.lastIndexOf( '.' ) ) ); boolean process = false; @@ -105,8 +101,7 @@ public class UnpackMojo tempLocation.mkdirs(); process = true; } - else if ( artifact.getFile() - .lastModified() > tempLocation.lastModified() ) + else if ( artifact.getFile().lastModified() > tempLocation.lastModified() ) { process = true; }