You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by dan tran <da...@gmail.com> on 2006/04/20 06:40:29 UTC
Re: svn commit: r395464 - /maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
Jesse,
If you scan your descriptors, make sure to skip sub descriptor type (
component )
-D
On 4/19/06, jmcconnell@apache.org <jm...@apache.org> wrote:
>
> Author: jmcconnell
> Date: Wed Apr 19 19:41:58 2006
> New Revision: 395464
>
> URL: http://svn.apache.org/viewcvs?rev=395464&view=rev
> Log:
> added descriptorSourceDirectory for specifying a directory to collect
> descriptors from for processing
>
> Modified:
>
> maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
>
> Modified:
> maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
> URL:
> http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java?rev=395464&r1=395463&r2=395464&view=diff
>
> ==============================================================================
> ---
> maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
> (original)
> +++
> maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
> Wed Apr 19 19:41:58 2006
> @@ -119,6 +119,13 @@
> private String[] descriptorRefs;
>
> /**
> + * directory to scan for descriptor files in
> + *
> + * @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
> @@ -572,6 +579,23 @@
> for ( int i = 0; i < descriptorRefs.length; i++ )
> {
> assemblies.add( getAssembly( descriptorRefs[i] ) );
> + }
> + }
> +
> + if ( descriptorSourceDirectory != null &&
> descriptorSourceDirectory.isDirectory() )
> + {
> + try
> + {
> + List descriptorList = FileUtils.getFiles(
> descriptorSourceDirectory, "**/*.xml", null );
> +
> + for (Iterator iter = descriptorList.iterator();
> iter.hasNext(); )
> + {
> + assemblies.add( getAssembly( (File)iter.next() ) );
> + }
> + }
> + catch ( IOException e )
> + {
> + throw new MojoFailureException( "error discovering
> descriptor files: " + e.getMessage() );
> }
> }
>
>
>
>