Author: jdcasey Date: Tue Sep 21 20:40:39 2010 New Revision: 999625 URL: http://svn.apache.org/viewvc?rev=999625&view=rev Log: deprecate all mojos except single, since the others are redundant or can lead to non-standard build processes with undesirable effects when used during the lifecycle. Also, adding a warning for dependencySets having concrete output location (outputDirectory + outputFileNameMapping) and matching multiple artifacts (which could lead to one or more being obscured.
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractDirectoryMojo.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 maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java?rev=999625&r1=999624&r2=999625&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/task/AddDependencySetsTask.java Tue Sep 21 20:40:39 2010 @@ -145,6 +145,10 @@ public class AddDependencySetsTask { filterContents = true; } + else if ( dependencyArtifacts.size() > 1 ) + { + checkMultiArtifactOutputConfig( dependencySet ); + } logger.debug( "Adding " + dependencyArtifacts.size() + " dependency artifacts." ); @@ -185,6 +189,29 @@ public class AddDependencySetsTask } } + private void checkMultiArtifactOutputConfig( final DependencySet dependencySet ) + { + String dir = dependencySet.getOutputDirectory(); + if ( dir == null ) + { + dir = defaultOutputDirectory; + } + + String mapping = dependencySet.getOutputFileNameMapping(); + if ( mapping == null ) + { + mapping = defaultOutputFileNameMapping; + } + + if ( ( dir != null && dir.indexOf( "${" ) < 0 ) || ( mapping != null && mapping.indexOf( "${" ) < 0 ) ) + { + logger.warn( "NOTE: Your assembly specifies a dependencySet that matches multiple artifacts, but specifies a concrete output format. " + + "THIS MAY RESULT IN ONE OR MORE ARTIFACTS BEING OBSCURED!\n\nOutput directory: '" + + dir + + "'\nOutput filename mapping: '" + mapping + "'" ); + } + } + private void addFilteredUnpackedArtifact( final DependencySet dependencySet, final Artifact depArtifact, final MavenProject depProject, final Archiver archiver, final AssemblerConfigurationSource configSource ) Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractDirectoryMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractDirectoryMojo.java?rev=999625&r1=999624&r2=999625&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractDirectoryMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/mojos/AbstractDirectoryMojo.java Tue Sep 21 20:40:39 2010 @@ -35,11 +35,13 @@ import java.util.List; /** * @version $Id$ */ +...@deprecated public abstract class AbstractDirectoryMojo extends AbstractAssemblyMojo { @Override - public void execute() throws MojoExecutionException, MojoFailureException + public void execute() + throws MojoExecutionException, MojoFailureException { final AssemblyReader reader = getAssemblyReader(); @@ -64,7 +66,8 @@ public abstract class AbstractDirectoryM } } - private void createDirectory( final Assembly assembly ) throws MojoExecutionException, MojoFailureException + private void createDirectory( final Assembly assembly ) + throws MojoExecutionException, MojoFailureException { final AssemblyArchiver archiver = getAssemblyArchiver(); 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=999625&r1=999624&r2=999625&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 Sep 21 20:40:39 2010 @@ -22,35 +22,35 @@ package org.apache.maven.plugin.assembly import org.apache.maven.project.MavenProject; /** - * Assemble an application bundle or distribution using an assembly descriptor from the command line. - * This goal will force Maven to build all included POMs up to the <code>package</code> phase BEFORE - * the assembly is processed. - * <br/> - * - * <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:single</code> goal for binding - * your assembly to the lifecycle. - * <br/> - * + * Assemble an application bundle or distribution using an assembly descriptor from the command line. This goal will + * force Maven to build all included POMs up to the <code>package</code> phase BEFORE the assembly is processed. <br/> + * + * <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:single</code> goal for binding your assembly to the lifecycle. <br/> + * * @author <a href="mailto:jdca...@apache.org">John Casey</a> * @author <a href="mailto:br...@apache.org">Brett Porter</a> * @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 public class AssemblyMojo extends AbstractAssemblyMojo { /** * Get the executed project from the forked lifecycle. - * + * * @parameter expression="${executedProject}" */ private MavenProject executedProject; + @Override public MavenProject getProject() { return executedProject; 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=999625&r1=999624&r2=999625&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 Sep 21 20:40:39 2010 @@ -22,23 +22,22 @@ package org.apache.maven.plugin.assembly import org.apache.maven.project.MavenProject; /** - * Assemble an application bundle or distribution from an assembly descriptor, - * WITHOUT first forcing Maven to build all POMs to the <code>package</code> - * phase (as is required by the <code>assembly:assembly</code> goal). - * <br/> - * - * <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:single</code> goal for binding - * your assembly to the lifecycle. - * + * Assemble an application bundle or distribution from an assembly descriptor, WITHOUT first forcing Maven to build all + * POMs to the <code>package</code> phase (as is required by the <code>assembly:assembly</code> goal). <br/> + * + * <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:single</code> goal for binding your assembly to the lifecycle. + * * @author <a href="mailto:jdca...@apache.org">John Casey</a> * @author <a href="mailto:jer...@coffeebreaks.org">Jerome Lacoste</a> * @version $Id$ - * + * * @goal attached * @aggregator - * @deprecated Use goal: 'assembly' (from the command line) or 'single' (from a lifecycle binding) instead. + * @inheritByDefault false + * @deprecated Use assembly:single instead! The assembly:attached mojo leads to non-standard builds. */ +...@deprecated public class AttachedAssemblyMojo extends AbstractAssemblyMojo { @@ -49,6 +48,7 @@ public class AttachedAssemblyMojo */ private MavenProject project; + @Override public MavenProject getProject() { return project; 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=999625&r1=999624&r2=999625&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 Sep 21 20:40:39 2010 @@ -22,31 +22,30 @@ package org.apache.maven.plugin.assembly import org.apache.maven.project.MavenProject; /** - * Like the <code>assembly:attached</code> goal, assemble an application bundle - * or distribution from an assembly descriptor, - * WITHOUT first forcing Maven to build all POMs to the <code>package</code> - * phase (as is required by the <code>assembly:assembly</code> goal). This goal - * differs from <code>assembly:attached</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/> + * Like the <code>assembly:attached</code> goal, assemble an application bundle or distribution from an assembly + * descriptor, WITHOUT first forcing Maven to build all POMs to the <code>package</code> phase (as is required by the + * <code>assembly:assembly</code> goal). This goal differs from <code>assembly:attached</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/> + * + * This goal is also functionally equivalent to using the <code>assembly:attached</code> goal in conjunction with the + * <code>dir</code> assembly format. <br/> + * + * <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. * - * This goal is also functionally equivalent to using the <code>assembly:attached</code> - * goal in conjunction with the <code>dir</code> assembly format. - * <br/> - * - * <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> * @author <a href="mailto:gscok...@users.sourceforge.net">Gilles Scokart</a> * @version $Id$ - * + * * @goal directory-inline * @aggregator - * @deprecated Use goal: 'directory' (from the command line) or 'directory-single' (from a lifecycle binding) instead. + * @inheritByDefault false + * @deprecated Use assembly:single and an assembly with format == dir instead! This mojo is redundant, and leads to + * non-standard builds. */ +...@deprecated public class DirectoryInlineMojo extends AbstractDirectoryMojo { @@ -57,6 +56,7 @@ public class DirectoryInlineMojo */ private MavenProject project; + @Override public MavenProject getProject() { return project; 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=999625&r1=999624&r2=999625&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 Sep 21 20:40:39 2010 @@ -22,39 +22,39 @@ package org.apache.maven.plugin.assembly import org.apache.maven.project.MavenProject; /** - * Like the <code>assembly:attached</code> goal, assemble an application bundle - * or distribution using an assembly descriptor from the command line. - * This goal will force Maven to build all included POMs up to the <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/> + * Like the <code>assembly:attached</code> goal, assemble an application bundle or distribution using an assembly + * descriptor from the command line. This goal will force Maven to build all included POMs up to the + * <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/> + * + * This goal is also functionally equivalent to using the <code>assembly:assembly</code> goal in conjunction with the + * <code>dir</code> assembly format. <br/> + * + * <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. * - * This goal is also functionally equivalent to using the <code>assembly:assembly</code> - * goal in conjunction with the <code>dir</code> assembly format. - * <br/> - * - * <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. */ +...@deprecated public class DirectoryMojo extends AbstractDirectoryMojo { /** * Get the executed project from the forked lifecycle. - * + * * @parameter expression="${executedProject}" */ private MavenProject executedProject; + @Override public MavenProject getProject() { return executedProject; 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=999625&r1=999624&r2=999625&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 Sep 21 20:40:39 2010 @@ -22,23 +22,24 @@ package org.apache.maven.plugin.assembly import org.apache.maven.project.MavenProject; /** - * Like the <code>assembly:attached</code> goal, 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). - * <br/> + * Like the <code>assembly:attached</code> goal, 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). <br/> + * + * This goal differs from <code>assembly:single</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>). * - * This goal differs from <code>assembly:single</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>). - * * @author <a href="mailto:jdca...@apache.org">John Casey</a> * @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. */ +...@deprecated public class DirectorySingleMojo extends AbstractDirectoryMojo { @@ -49,6 +50,7 @@ public class DirectorySingleMojo */ private MavenProject project; + @Override public MavenProject getProject() { return project; 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=999625&r1=999624&r2=999625&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 Sep 21 20:40:39 2010 @@ -22,16 +22,15 @@ package org.apache.maven.plugin.assembly 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). - * + * 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 */ public class SingleAssemblyMojo extends AbstractAssemblyMojo @@ -43,6 +42,7 @@ public class SingleAssemblyMojo */ private MavenProject project; + @Override public MavenProject getProject() { return project; 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=999625&r1=999624&r2=999625&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 Sep 21 20:40:39 2010 @@ -40,6 +40,7 @@ import java.util.Set; * @version $Id$ * @goal unpack * @requiresDependencyResolution test + * @inheritByDefault false * @deprecated Use org.apache.maven.plugins:maven-dependency-plugin goal: unpack or unpack-dependencies instead. */ @Deprecated Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo?rev=999625&r1=999624&r2=999625&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/component.mdo Tue Sep 21 20:40:39 2010 @@ -587,7 +587,7 @@ <type>String</type> <description> <![CDATA[ - Sets the line-endings of the files. + Sets the line-endings of the files. (Since 2.2) Valid values: <ul> <li><b>"keep"</b> - Preserve all line endings</li> Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo?rev=999625&r1=999624&r2=999625&view=diff ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/mdo/descriptor.mdo Tue Sep 21 20:40:39 2010 @@ -978,7 +978,7 @@ <type>String</type> <description> <![CDATA[ - Sets the line-endings of the files. + Sets the line-endings of the files. (Since 2.2) Valid values: <ul> <li><b>"keep"</b> - Preserve all line endings</li>