You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2010/09/21 22:34:53 UTC
svn commit: r999612 [4/10] - in /maven/plugins/trunk/maven-assembly-plugin:
./ src/main/java/org/apache/maven/plugin/assembly/
src/main/java/org/apache/maven/plugin/assembly/archive/
src/main/java/org/apache/maven/plugin/assembly/archive/archiver/ src/...
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/ReflectionProperties.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/ReflectionProperties.java?rev=999612&r1=999611&r2=999612&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/ReflectionProperties.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/format/ReflectionProperties.java Tue Sep 21 20:34:50 2010
@@ -22,54 +22,57 @@ import org.codehaus.plexus.util.introspe
import java.util.Properties;
-
/**
* @author Andreas Hoheneder (ahoh_at_inode.at)
* @version $Id$
- *
- * @depcrecated
+ *
+ * @depcrecated
*/
+@Deprecated
public class ReflectionProperties
extends Properties
{
- private MavenProject project;
+ private static final long serialVersionUID = 1L;
+
+ private final MavenProject project;
boolean escapedBackslashesInFilePath;
- public ReflectionProperties( MavenProject aProject, boolean escapedBackslashesInFilePath )
+ public ReflectionProperties( final MavenProject aProject, final boolean escapedBackslashesInFilePath )
{
- super();
+ super();
- project = aProject;
+ project = aProject;
- this.escapedBackslashesInFilePath = escapedBackslashesInFilePath;
+ this.escapedBackslashesInFilePath = escapedBackslashesInFilePath;
}
-
- public Object get( Object key )
+
+ @Override
+ public Object get( final Object key )
{
Object value = null;
- try
+ try
{
- value = ReflectionValueExtractor.evaluate( "" + key , project );
+ value = ReflectionValueExtractor.evaluate( "" + key, project );
- if ( escapedBackslashesInFilePath && value != null &&
- "java.lang.String".equals( value.getClass().getName() ) )
+ if ( escapedBackslashesInFilePath && value != null && "java.lang.String".equals( value.getClass()
+ .getName() ) )
{
- String val = (String) value;
+ final String val = (String) value;
// Check if it's a windows path
if ( val.indexOf( ":\\" ) == 1 )
{
- value = StringUtils.replace( (String)value, "\\", "\\\\" );
- value = StringUtils.replace( (String)value, ":", "\\:" );
+ value = StringUtils.replace( (String) value, "\\", "\\\\" );
+ value = StringUtils.replace( (String) value, ":", "\\:" );
}
}
}
- catch ( Exception e )
+ catch ( final Exception e )
{
- //TODO: remove the try-catch block when ReflectionValueExtractor.evaluate() throws no more exceptions
- }
+ // TODO: remove the try-catch block when ReflectionValueExtractor.evaluate() throws no more exceptions
+ }
return value;
}
}
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolationException.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolationException.java?rev=999612&r1=999611&r2=999612&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolationException.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolationException.java Tue Sep 21 20:34:50 2010
@@ -25,34 +25,36 @@ package org.apache.maven.plugin.assembly
public class AssemblyInterpolationException
extends Exception
{
+ private static final long serialVersionUID = 1L;
+
private String expression;
private String originalMessage;
- public AssemblyInterpolationException( String message )
+ public AssemblyInterpolationException( final String message )
{
super( message );
}
- public AssemblyInterpolationException( String message, Throwable cause )
+ public AssemblyInterpolationException( final String message, final Throwable cause )
{
super( message, cause );
}
- public AssemblyInterpolationException( String expression, String message, Throwable cause )
+ public AssemblyInterpolationException( final String expression, final String message, final Throwable cause )
{
super( "The Assembly expression: " + expression + " could not be evaluated. Reason: " + message, cause );
this.expression = expression;
- this.originalMessage = message;
+ originalMessage = message;
}
- public AssemblyInterpolationException( String expression, String message )
+ public AssemblyInterpolationException( final String expression, final String message )
{
super( "The Assembly expression: " + expression + " could not be evaluated. Reason: " + message );
this.expression = expression;
- this.originalMessage = message;
+ originalMessage = message;
}
public String getExpression()
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java?rev=999612&r1=999611&r2=999612&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/interpolation/AssemblyInterpolator.java Tue Sep 21 20:34:50 2010
@@ -56,63 +56,66 @@ import java.util.Set;
public class AssemblyInterpolator
extends AbstractLogEnabled
{
- private static final Set INTERPOLATION_BLACKLIST;
+ private static final Set<String> INTERPOLATION_BLACKLIST;
private static final Properties ENVIRONMENT_VARIABLES;
-
+
static
{
- Set blacklist = new HashSet();
+ final Set<String> blacklist = new HashSet<String>();
blacklist.add( "outputFileNameMapping" );
blacklist.add( "outputDirectoryMapping" );
blacklist.add( "outputDirectory" );
INTERPOLATION_BLACKLIST = blacklist;
-
+
Properties environmentVariables;
try
{
environmentVariables = CommandLineUtils.getSystemEnvVars( false );
}
- catch ( IOException e )
+ catch ( final IOException e )
{
environmentVariables = new Properties();
}
-
+
ENVIRONMENT_VARIABLES = environmentVariables;
}
- public AssemblyInterpolator()
- throws IOException
+ public AssemblyInterpolator() throws IOException
{
}
- public Assembly interpolate( Assembly assembly, MavenProject project, AssemblerConfigurationSource configSource )
+ public Assembly interpolate( final Assembly assembly, final MavenProject project,
+ final AssemblerConfigurationSource configSource )
throws AssemblyInterpolationException
{
- Set blacklistFields = new HashSet( FieldBasedObjectInterpolator.DEFAULT_BLACKLISTED_FIELD_NAMES );
+ @SuppressWarnings( "unchecked" )
+ final Set<String> blacklistFields =
+ new HashSet<String>( FieldBasedObjectInterpolator.DEFAULT_BLACKLISTED_FIELD_NAMES );
blacklistFields.addAll( INTERPOLATION_BLACKLIST );
- Set blacklistPkgs = FieldBasedObjectInterpolator.DEFAULT_BLACKLISTED_PACKAGE_PREFIXES;
+ @SuppressWarnings( "unchecked" )
+ final Set<String> blacklistPkgs = FieldBasedObjectInterpolator.DEFAULT_BLACKLISTED_PACKAGE_PREFIXES;
- FieldBasedObjectInterpolator objectInterpolator =
+ final FieldBasedObjectInterpolator objectInterpolator =
new FieldBasedObjectInterpolator( blacklistFields, blacklistPkgs );
- Interpolator interpolator = buildInterpolator( project, configSource );
+ final Interpolator interpolator = buildInterpolator( project, configSource );
// TODO: Will this adequately detect cycles between prefixed property references and prefixed project
// references??
- RecursionInterceptor interceptor =
+ final RecursionInterceptor interceptor =
new PrefixAwareRecursionInterceptor( InterpolationConstants.PROJECT_PREFIXES, true );
try
{
objectInterpolator.interpolate( assembly, interpolator, interceptor );
}
- catch ( InterpolationException e )
+ catch ( final InterpolationException e )
{
throw new AssemblyInterpolationException( "Failed to interpolate assembly with ID: " + assembly.getId()
- + ". Reason: " + e.getMessage(), e );
+ + ". Reason: " + e.getMessage(), e );
}
finally
{
@@ -121,17 +124,19 @@ public class AssemblyInterpolator
if ( objectInterpolator.hasWarnings() && getLogger().isDebugEnabled() )
{
- StringBuffer sb = new StringBuffer();
+ final StringBuffer sb = new StringBuffer();
sb.append( "One or more minor errors occurred while interpolating the assembly with ID: "
- + assembly.getId() + ":\n" );
+ + assembly.getId() + ":\n" );
- List warnings = objectInterpolator.getWarnings();
- for ( Iterator it = warnings.iterator(); it.hasNext(); )
+ @SuppressWarnings( "unchecked" )
+ final List<ObjectInterpolationWarning> warnings = objectInterpolator.getWarnings();
+ for ( final Iterator<ObjectInterpolationWarning> it = warnings.iterator(); it.hasNext(); )
{
- ObjectInterpolationWarning warning = (ObjectInterpolationWarning) it.next();
+ final ObjectInterpolationWarning warning = it.next();
- sb.append( '\n' ).append( warning );
+ sb.append( '\n' )
+ .append( warning );
}
sb.append( "\n\nThese values were SKIPPED, but the assembly process will continue.\n" );
@@ -142,12 +147,13 @@ public class AssemblyInterpolator
return assembly;
}
- public static Interpolator buildInterpolator( final MavenProject project, AssemblerConfigurationSource configSource )
+ public static Interpolator buildInterpolator( final MavenProject project,
+ final AssemblerConfigurationSource configSource )
{
- StringSearchInterpolator interpolator = new StringSearchInterpolator();
+ final StringSearchInterpolator interpolator = new StringSearchInterpolator();
interpolator.setCacheAnswers( true );
- MavenSession session = configSource.getMavenSession();
+ final MavenSession session = configSource.getMavenSession();
if ( session != null )
{
@@ -156,7 +162,7 @@ public class AssemblyInterpolator
{
userProperties = session.getExecutionProperties();
}
- catch ( NoSuchMethodError nsmer )
+ catch ( final NoSuchMethodError nsmer )
{
// OK, so user is using Maven <= 2.0.8. No big deal.
}
@@ -183,20 +189,21 @@ public class AssemblyInterpolator
}
}
- catch ( NoSuchMethodError nsmer )
+ catch ( final NoSuchMethodError nsmer )
{
// OK, so user is using Maven <= 2.0.8. No big deal.
}
// 7
interpolator.addValueSource( new PropertiesBasedValueSource( commandLineProperties ) );
- interpolator.addValueSource( new PrefixedPropertiesValueSource( Collections.singletonList( "env." ), ENVIRONMENT_VARIABLES,
- true ) );
-
+ interpolator.addValueSource( new PrefixedPropertiesValueSource( Collections.singletonList( "env." ),
+ ENVIRONMENT_VARIABLES, true ) );
+
interpolator.addPostProcessor( new PathTranslatingPostProcessor( project.getBasedir() ) );
return interpolator;
}
+ @Override
protected Logger getLogger()
{
Logger logger = super.getLogger();
@@ -210,22 +217,23 @@ public class AssemblyInterpolator
return logger;
}
-
- private static final class PathTranslatingPostProcessor implements InterpolationPostProcessor
+
+ private static final class PathTranslatingPostProcessor
+ implements InterpolationPostProcessor
{
private final File basedir;
- public PathTranslatingPostProcessor( File basedir )
+ public PathTranslatingPostProcessor( final File basedir )
{
this.basedir = basedir;
}
- public Object execute( String expression, Object value )
+ public Object execute( final String expression, final Object value )
{
- String path = String.valueOf( value );
+ final String path = String.valueOf( value );
return AssemblyFileUtils.makePathRelativeTo( path, basedir );
}
-
+
}
}
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/AssemblyReadException.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/AssemblyReadException.java?rev=999612&r1=999611&r2=999612&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/AssemblyReadException.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/AssemblyReadException.java Tue Sep 21 20:34:50 2010
@@ -26,12 +26,14 @@ public class AssemblyReadException
extends Exception
{
- public AssemblyReadException( String message, Throwable cause )
+ private static final long serialVersionUID = 1L;
+
+ public AssemblyReadException( final String message, final Throwable cause )
{
super( message, cause );
}
- public AssemblyReadException( String message )
+ public AssemblyReadException( final String message )
{
super( message );
}
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/AssemblyReader.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/AssemblyReader.java?rev=999612&r1=999611&r2=999612&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/AssemblyReader.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/AssemblyReader.java Tue Sep 21 20:34:50 2010
@@ -34,7 +34,7 @@ import java.util.List;
public interface AssemblyReader
{
- public List readAssemblies( AssemblerConfigurationSource configSource )
+ public List<Assembly> readAssemblies( AssemblerConfigurationSource configSource )
throws AssemblyReadException, InvalidAssemblerConfigurationException;
public Assembly getAssemblyForDescriptorReference( String ref, AssemblerConfigurationSource configSource )
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java?rev=999612&r1=999611&r2=999612&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/io/DefaultAssemblyReader.java Tue Sep 21 20:34:50 2010
@@ -25,9 +25,9 @@ import org.apache.maven.plugin.MojoExecu
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
+import org.apache.maven.plugin.assembly.interpolation.AssemblyExpressionEvaluator;
import org.apache.maven.plugin.assembly.interpolation.AssemblyInterpolationException;
import org.apache.maven.plugin.assembly.interpolation.AssemblyInterpolator;
-import org.apache.maven.plugin.assembly.interpolation.AssemblyExpressionEvaluator;
import org.apache.maven.plugin.assembly.model.Assembly;
import org.apache.maven.plugin.assembly.model.Component;
import org.apache.maven.plugin.assembly.model.ContainerDescriptorHandlerConfig;
@@ -46,6 +46,7 @@ import org.apache.maven.shared.io.locati
import org.apache.maven.shared.io.location.Locator;
import org.apache.maven.shared.io.location.LocatorStrategy;
import org.apache.maven.shared.io.location.URLLocatorStrategy;
+import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.logging.console.ConsoleLogger;
@@ -72,32 +73,28 @@ import java.util.Set;
/**
* @version $Id$
- * @plexus.component role="org.apache.maven.plugin.assembly.io.AssemblyReader" role-hint="default"
*/
+@org.codehaus.plexus.component.annotations.Component( role = AssemblyReader.class )
public class DefaultAssemblyReader
extends AbstractLogEnabled
implements AssemblyReader
{
- /**
- * @plexus.requirement
- */
+ @Requirement
private ArtifactFactory factory;
- /**
- * @plexus.requirement
- */
+ @Requirement
private ArtifactResolver resolver;
- public List readAssemblies( AssemblerConfigurationSource configSource )
+ public List<Assembly> readAssemblies( final AssemblerConfigurationSource configSource )
throws AssemblyReadException, InvalidAssemblerConfigurationException
{
- Locator locator = new Locator();
+ final Locator locator = new Locator();
- LocatorStrategy prefixedClasspathStrategy = new PrefixedClasspathLocatorStrategy( "/assemblies/" );
- LocatorStrategy classpathStrategy = new ClasspathResourceLocatorStrategy();
+ final LocatorStrategy prefixedClasspathStrategy = new PrefixedClasspathLocatorStrategy( "/assemblies/" );
+ final LocatorStrategy classpathStrategy = new ClasspathResourceLocatorStrategy();
- List strategies = new ArrayList();
+ final List<LocatorStrategy> strategies = new ArrayList<LocatorStrategy>();
strategies.add( new RelativeFileLocatorStrategy( configSource.getBasedir() ) );
strategies.add( new ArtifactLocatorStrategy( factory, resolver, configSource.getLocalRepository(),
@@ -108,17 +105,17 @@ public class DefaultAssemblyReader
strategies.add( new FileLocatorStrategy() );
strategies.add( new URLLocatorStrategy() );
- List refStrategies = new ArrayList();
+ final List<LocatorStrategy> refStrategies = new ArrayList<LocatorStrategy>();
refStrategies.add( prefixedClasspathStrategy );
refStrategies.add( classpathStrategy );
- List assemblies = new ArrayList();
+ final List<Assembly> assemblies = new ArrayList<Assembly>();
- String descriptor = configSource.getDescriptor();
- String descriptorId = configSource.getDescriptorId();
- String[] descriptors = configSource.getDescriptors();
- String[] descriptorRefs = configSource.getDescriptorReferences();
- File descriptorSourceDirectory = configSource.getDescriptorSourceDirectory();
+ final String descriptor = configSource.getDescriptor();
+ final String descriptorId = configSource.getDescriptorId();
+ final String[] descriptors = configSource.getDescriptors();
+ final String[] descriptorRefs = configSource.getDescriptorReferences();
+ final File descriptorSourceDirectory = configSource.getDescriptorSourceDirectory();
if ( descriptor != null )
{
@@ -153,11 +150,12 @@ public class DefaultAssemblyReader
if ( ( descriptorSourceDirectory != null ) && descriptorSourceDirectory.isDirectory() )
{
- locator.setStrategies( Collections.singletonList( new RelativeFileLocatorStrategy( descriptorSourceDirectory ) ) );
+ locator.setStrategies( Collections.singletonList( new RelativeFileLocatorStrategy(
+ descriptorSourceDirectory ) ) );
- DirectoryScanner scanner = new DirectoryScanner();
+ final DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir( descriptorSourceDirectory );
- scanner.setIncludes( new String[]{ "**/*.xml" } );
+ scanner.setIncludes( new String[] { "**/*.xml" } );
scanner.addDefaultExcludes();
try
@@ -165,17 +163,16 @@ public class DefaultAssemblyReader
scanner.scan();
}
// FIXME: plexus-utils >= 1.3-SNAPSHOT should fix this.
- catch ( NullPointerException e )
+ catch ( final NullPointerException e )
{
- StackTraceElement frameZero = e.getStackTrace()[0];
+ final StackTraceElement frameZero = e.getStackTrace()[0];
if ( "org.codehaus.plexus.util.DirectoryScanner".equals( frameZero.getClassName() )
&& "scandir".equals( frameZero.getMethodName() ) )
{
if ( getLogger().isDebugEnabled() )
{
- getLogger().debug(
- "Caught filesystem error while scanning directories..."
+ getLogger().debug( "Caught filesystem error while scanning directories..."
+ "using zero-length list as the result.", e );
}
}
@@ -185,7 +182,7 @@ public class DefaultAssemblyReader
}
}
- String[] paths = scanner.getIncludedFiles();
+ final String[] paths = scanner.getIncludedFiles();
if ( paths != null )
{
@@ -209,10 +206,10 @@ public class DefaultAssemblyReader
}
// check unique IDs
- Set ids = new HashSet();
- for ( Iterator i = assemblies.iterator(); i.hasNext(); )
+ final Set<String> ids = new HashSet<String>();
+ for ( final Iterator<Assembly> i = assemblies.iterator(); i.hasNext(); )
{
- Assembly assembly = (Assembly) i.next();
+ final Assembly assembly = i.next();
if ( !ids.add( assembly.getId() ) )
{
getLogger().warn( "The assembly id " + assembly.getId() + " is used more than once." );
@@ -222,22 +219,26 @@ public class DefaultAssemblyReader
return assemblies;
}
- public Assembly getAssemblyForDescriptorReference( String ref, AssemblerConfigurationSource configSource )
+ public Assembly getAssemblyForDescriptorReference( final String ref, final AssemblerConfigurationSource configSource )
throws AssemblyReadException, InvalidAssemblerConfigurationException
{
- return addAssemblyForDescriptorReference( ref, configSource, new ArrayList( 1 ) );
+ return addAssemblyForDescriptorReference( ref, configSource, new ArrayList<Assembly>( 1 ) );
}
- public Assembly getAssemblyFromDescriptorFile( File file, AssemblerConfigurationSource configSource )
+ public Assembly getAssemblyFromDescriptorFile( final File file, final AssemblerConfigurationSource configSource )
throws AssemblyReadException, InvalidAssemblerConfigurationException
{
- return addAssemblyFromDescriptorFile( file, configSource, new ArrayList( 1 ) );
+ return addAssemblyFromDescriptorFile( file, configSource, new ArrayList<Assembly>( 1 ) );
}
- private Assembly addAssemblyForDescriptorReference( String ref, AssemblerConfigurationSource configSource, List assemblies )
+ private Assembly addAssemblyForDescriptorReference( final String ref,
+ final AssemblerConfigurationSource configSource,
+ final List<Assembly> assemblies )
throws AssemblyReadException, InvalidAssemblerConfigurationException
{
- InputStream resourceAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream( "assemblies/" + ref + ".xml" );
+ final InputStream resourceAsStream = Thread.currentThread()
+ .getContextClassLoader()
+ .getResourceAsStream( "assemblies/" + ref + ".xml" );
if ( resourceAsStream == null )
{
@@ -255,19 +256,22 @@ public class DefaultAssemblyReader
try
{
// TODO use ReaderFactory.newXmlReader() when plexus-utils is upgraded to 1.4.5+
- Assembly assembly = readAssembly( new InputStreamReader( resourceAsStream, "UTF-8" ), ref, configSource );
+ final Assembly assembly =
+ readAssembly( new InputStreamReader( resourceAsStream, "UTF-8" ), ref, configSource );
assemblies.add( assembly );
return assembly;
}
- catch ( UnsupportedEncodingException e )
+ catch ( final UnsupportedEncodingException e )
{
// should not occur since UTF-8 support is mandatory
throw new AssemblyReadException( "Encoding not supported for descriptor with ID '" + ref + "'" );
}
}
- private Assembly addAssemblyFromDescriptorFile( File descriptor, AssemblerConfigurationSource configSource, List assemblies )
+ private Assembly addAssemblyFromDescriptorFile( final File descriptor,
+ final AssemblerConfigurationSource configSource,
+ final List<Assembly> assemblies )
throws AssemblyReadException, InvalidAssemblerConfigurationException
{
if ( !descriptor.exists() )
@@ -288,13 +292,13 @@ public class DefaultAssemblyReader
{
// TODO use ReaderFactory.newXmlReader() when plexus-utils is upgraded to 1.4.5+
r = new InputStreamReader( new FileInputStream( descriptor ), "UTF-8" );
- Assembly assembly = readAssembly( r, descriptor.getAbsolutePath(), configSource );
+ final Assembly assembly = readAssembly( r, descriptor.getAbsolutePath(), configSource );
assemblies.add( assembly );
return assembly;
}
- catch ( IOException e )
+ catch ( final IOException e )
{
throw new AssemblyReadException( "Error reading assembly descriptor: " + descriptor, e );
}
@@ -304,39 +308,43 @@ public class DefaultAssemblyReader
}
}
- private Assembly addAssemblyFromDescriptor( String spec, Locator locator, AssemblerConfigurationSource configSource, List assemblies )
+ private Assembly addAssemblyFromDescriptor( final String spec, final Locator locator,
+ final AssemblerConfigurationSource configSource,
+ final List<Assembly> assemblies )
throws AssemblyReadException, InvalidAssemblerConfigurationException
{
- Location location = locator.resolve( spec );
+ final Location location = locator.resolve( spec );
if ( location == null )
{
if ( configSource.isIgnoreMissingDescriptor() )
{
getLogger().debug( "Ignoring missing assembly descriptor with ID '" + spec
- + "' per configuration.\nLocator output was:\n\n"
- + locator.getMessageHolder().render() );
+ + "' per configuration.\nLocator output was:\n\n"
+ + locator.getMessageHolder()
+ .render() );
return null;
}
else
{
- throw new AssemblyReadException( "Error locating assembly descriptor: " + spec
- + "\n\n" + locator.getMessageHolder().render() );
+ throw new AssemblyReadException( "Error locating assembly descriptor: " + spec + "\n\n"
+ + locator.getMessageHolder()
+ .render() );
}
}
Reader r = null;
try
{
- // TODO use ReaderFactory.newXmlReader() when plexus-utils is upgraded to 1.4.5+
+ // TODO use ReaderFactory.newXmlReader() when plexus-utils is upgraded to 1.4.5+
r = new InputStreamReader( location.getInputStream(), "UTF-8" );
- Assembly assembly = readAssembly( r, spec, configSource );
+ final Assembly assembly = readAssembly( r, spec, configSource );
assemblies.add( assembly );
return assembly;
}
- catch ( IOException e )
+ catch ( final IOException e )
{
throw new AssemblyReadException( "Error reading assembly descriptor: " + spec, e );
}
@@ -347,21 +355,28 @@ public class DefaultAssemblyReader
}
- public Assembly readAssembly( Reader reader, String locationDescription, AssemblerConfigurationSource configSource )
+ public Assembly readAssembly( final Reader reader, final String locationDescription,
+ final AssemblerConfigurationSource configSource )
throws AssemblyReadException, InvalidAssemblerConfigurationException
{
Assembly assembly;
- File basedir = configSource.getBasedir();
- MavenProject project = configSource.getProject();
+ final File basedir = configSource.getBasedir();
+ final MavenProject project = configSource.getProject();
try
{
- Map context = new HashMap( System.getProperties() );
+ final Map<String, String> context = new HashMap<String, String>();
+ for ( final Object k : System.getProperties()
+ .keySet() )
+ {
+ final String key = (String) k;
+ context.put( key, System.getProperty( key ) );
+ }
context.put( "basedir", basedir.getAbsolutePath() );
- AssemblyXpp3Reader r = new AssemblyXpp3Reader();
+ final AssemblyXpp3Reader r = new AssemblyXpp3Reader();
assembly = r.read( reader );
mergeComponentsWithMainAssembly( assembly, configSource );
@@ -372,17 +387,20 @@ public class DefaultAssemblyReader
debugPrintAssembly( "After assembly is interpolated:", assembly );
}
- catch ( IOException e )
+ catch ( final IOException e )
{
- throw new AssemblyReadException( "Error reading descriptor at: " + locationDescription + ": " + e.getMessage(), e );
+ throw new AssemblyReadException( "Error reading descriptor at: " + locationDescription + ": "
+ + e.getMessage(), e );
}
- catch ( XmlPullParserException e )
+ catch ( final XmlPullParserException e )
{
- throw new AssemblyReadException( "Error reading descriptor at: " + locationDescription + ": " + e.getMessage(), e );
+ throw new AssemblyReadException( "Error reading descriptor at: " + locationDescription + ": "
+ + e.getMessage(), e );
}
- catch ( AssemblyInterpolationException e )
+ catch ( final AssemblyInterpolationException e )
{
- throw new AssemblyReadException( "Error reading descriptor at: " + locationDescription + ": " + e.getMessage(), e );
+ throw new AssemblyReadException( "Error reading descriptor at: " + locationDescription + ": "
+ + e.getMessage(), e );
}
finally
{
@@ -397,16 +415,17 @@ public class DefaultAssemblyReader
return assembly;
}
- private void debugPrintAssembly( String message, Assembly assembly )
+ private void debugPrintAssembly( final String message, final Assembly assembly )
{
- StringWriter sWriter = new StringWriter();
+ final StringWriter sWriter = new StringWriter();
try
{
new AssemblyXpp3Writer().write( sWriter, assembly );
}
- catch ( IOException e )
+ catch ( final IOException e )
{
- getLogger().debug( "Failed to print debug message with assembly descriptor listing, and message: " + message, e );
+ getLogger().debug( "Failed to print debug message with assembly descriptor listing, and message: "
+ + message, e );
}
getLogger().debug( message + "\n\n" + sWriter.toString() + "\n\n" );
@@ -414,55 +433,56 @@ public class DefaultAssemblyReader
/**
* Add the contents of all included components to main assembly
- *
+ *
* @param assembly
* @throws AssemblyReadException
* @throws MojoFailureException
* @throws MojoExecutionException
*/
- protected void mergeComponentsWithMainAssembly( Assembly assembly, AssemblerConfigurationSource configSource )
+ protected void mergeComponentsWithMainAssembly( final Assembly assembly,
+ final AssemblerConfigurationSource configSource )
throws AssemblyReadException
{
- RelativeFileLocatorStrategy rfls = new RelativeFileLocatorStrategy( configSource.getBasedir() );
+ final RelativeFileLocatorStrategy rfls = new RelativeFileLocatorStrategy( configSource.getBasedir() );
// allow absolute paths in componentDescriptor... MASSEMBLY-486
- FileLocatorStrategy afls = new FileLocatorStrategy();
+ final FileLocatorStrategy afls = new FileLocatorStrategy();
- ClasspathResourceLocatorStrategy crls = new ClasspathResourceLocatorStrategy();
+ final ClasspathResourceLocatorStrategy crls = new ClasspathResourceLocatorStrategy();
- ArtifactLocatorStrategy als = new ArtifactLocatorStrategy( factory, resolver,
- configSource.getLocalRepository(),
- configSource.getRemoteRepositories(),
- "assembly-component" );
+ final ArtifactLocatorStrategy als =
+ new ArtifactLocatorStrategy( factory, resolver, configSource.getLocalRepository(),
+ configSource.getRemoteRepositories(), "assembly-component" );
- URLLocatorStrategy uls = new URLLocatorStrategy();
+ final URLLocatorStrategy uls = new URLLocatorStrategy();
- Locator locator = new Locator();
+ final Locator locator = new Locator();
locator.addStrategy( rfls );
locator.addStrategy( afls );
locator.addStrategy( als );
locator.addStrategy( crls );
locator.addStrategy( uls );
- AssemblyExpressionEvaluator aee = new AssemblyExpressionEvaluator( configSource );
+ final AssemblyExpressionEvaluator aee = new AssemblyExpressionEvaluator( configSource );
- List componentLocations = assembly.getComponentDescriptors();
+ final List<String> componentLocations = assembly.getComponentDescriptors();
- for ( Iterator it = componentLocations.iterator(); it.hasNext(); )
+ for ( final Iterator<String> it = componentLocations.iterator(); it.hasNext(); )
{
- String location = (String) it.next();
-
+ String location = it.next();
+
// allow expressions in path to component descriptor... MASSEMBLY-486
try
{
- location = aee.evaluate( location ).toString();
+ location = aee.evaluate( location )
+ .toString();
}
- catch ( Exception eee )
+ catch ( final Exception eee )
{
getLogger().error( "Error interpolating componentDescriptor: " + location, eee );
}
- Location resolvedLocation = locator.resolve( location );
+ final Location resolvedLocation = locator.resolve( location );
if ( resolvedLocation == null )
{
@@ -475,11 +495,11 @@ public class DefaultAssemblyReader
reader = new InputStreamReader( resolvedLocation.getInputStream() );
component = new ComponentXpp3Reader().read( reader );
}
- catch ( IOException e )
+ catch ( final IOException e )
{
throw new AssemblyReadException( "Error reading component descriptor", e );
}
- catch ( XmlPullParserException e )
+ catch ( final XmlPullParserException e )
{
throw new AssemblyReadException( "Error reading component descriptor", e );
}
@@ -494,69 +514,71 @@ public class DefaultAssemblyReader
/**
* Add the content of a single Component to main assembly
+ *
* @param component
* @param assembly
*/
- protected void mergeComponentWithAssembly( Component component, Assembly assembly )
+ protected void mergeComponentWithAssembly( final Component component, final Assembly assembly )
{
- List containerHandlerDescriptors = component.getContainerDescriptorHandlers();
+ final List<ContainerDescriptorHandlerConfig> containerHandlerDescriptors =
+ component.getContainerDescriptorHandlers();
- for ( Iterator it = containerHandlerDescriptors.iterator(); it.hasNext(); )
+ for ( final Iterator<ContainerDescriptorHandlerConfig> it = containerHandlerDescriptors.iterator(); it.hasNext(); )
{
- ContainerDescriptorHandlerConfig cfg = (ContainerDescriptorHandlerConfig) it.next();
+ final ContainerDescriptorHandlerConfig cfg = it.next();
assembly.addContainerDescriptorHandler( cfg );
}
- List dependencySetList = component.getDependencySets();
+ final List<DependencySet> dependencySetList = component.getDependencySets();
- for ( Iterator it = dependencySetList.iterator(); it.hasNext(); )
+ for ( final Iterator<DependencySet> it = dependencySetList.iterator(); it.hasNext(); )
{
- DependencySet dependencySet = ( DependencySet ) it.next();
+ final DependencySet dependencySet = it.next();
assembly.addDependencySet( dependencySet );
}
- List fileSetList = component.getFileSets();
+ final List<FileSet> fileSetList = component.getFileSets();
- for ( Iterator it = fileSetList.iterator(); it.hasNext(); )
+ for ( final Iterator<FileSet> it = fileSetList.iterator(); it.hasNext(); )
{
- FileSet fileSet = ( FileSet ) it.next();
+ final FileSet fileSet = it.next();
assembly.addFileSet( fileSet );
}
- List fileList = component.getFiles();
+ final List<FileItem> fileList = component.getFiles();
- for ( Iterator it = fileList.iterator(); it.hasNext(); )
+ for ( final Iterator<FileItem> it = fileList.iterator(); it.hasNext(); )
{
- FileItem fileItem = ( FileItem ) it.next();
+ final FileItem fileItem = it.next();
assembly.addFile( fileItem );
}
- List repositoriesList = component.getRepositories();
+ final List<Repository> repositoriesList = component.getRepositories();
- for ( Iterator it = repositoriesList.iterator(); it.hasNext(); )
+ for ( final Iterator<Repository> it = repositoriesList.iterator(); it.hasNext(); )
{
- Repository repository = ( Repository ) it.next();
+ final Repository repository = it.next();
assembly.addRepository( repository );
}
}
- public void includeSiteInAssembly( Assembly assembly, AssemblerConfigurationSource configSource )
+ public void includeSiteInAssembly( final Assembly assembly, final AssemblerConfigurationSource configSource )
throws InvalidAssemblerConfigurationException
{
- File siteDirectory = configSource.getSiteDirectory();
+ final File siteDirectory = configSource.getSiteDirectory();
if ( !siteDirectory.exists() )
{
throw new InvalidAssemblerConfigurationException(
- "site did not exist in the target directory - please run site:site before creating the assembly" );
+ "site did not exist in the target directory - please run site:site before creating the assembly" );
}
getLogger().info( "Adding site directory to assembly : " + siteDirectory );
- FileSet siteFileSet = new FileSet();
+ final FileSet siteFileSet = new FileSet();
siteFileSet.setDirectory( siteDirectory.getPath() );
@@ -565,6 +587,7 @@ public class DefaultAssemblyReader
assembly.addFileSet( siteFileSet );
}
+ @Override
protected Logger getLogger()
{
Logger logger = super.getLogger();
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=999612&r1=999611&r2=999612&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 Sep 21 20:34:50 2010
@@ -51,41 +51,37 @@ import java.util.List;
* @version $Id$
*/
public abstract class AbstractAssemblyMojo
-extends AbstractMojo
-implements AssemblerConfigurationSource
+ extends AbstractMojo
+ implements AssemblerConfigurationSource
{
/**
- * 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.
- *
+ * 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="${skipAssembly}" default-value="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"
*/
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.
- *
+ * 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"
*/
private boolean ignoreDirFormatExtensions;
/**
* Local Maven repository where artifacts are cached during the build process.
- *
+ *
* @parameter default-value="${localRepository}"
* @required
* @readonly
@@ -97,20 +93,20 @@ implements AssemblerConfigurationSource
* @required
* @readonly
*/
- private List remoteRepositories;
+ private List<ArtifactRepository> remoteRepositories;
/**
* Contains the full list of projects in the reactor.
- *
+ *
* @parameter default-value="${reactorProjects}"
* @required
* @readonly
*/
- private List reactorProjects;
+ private List<MavenProject> reactorProjects;
/**
* The output directory of the assembled distribution file.
- *
+ *
* @parameter default-value="${project.build.directory}"
* @required
*/
@@ -118,7 +114,7 @@ implements AssemblerConfigurationSource
/**
* The filename of the assembled distribution file.
- *
+ *
* @parameter default-value="${project.build.finalName}"
* @required
*/
@@ -126,7 +122,7 @@ implements AssemblerConfigurationSource
/**
* Directory to unpack JARs into if needed
- *
+ *
* @parameter default-value="${project.build.directory}/assembly/work"
* @required
*/
@@ -135,15 +131,17 @@ implements AssemblerConfigurationSource
/**
* 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" )
private String classifier;
/**
* A list of descriptor files to generate from.
- *
+ *
* @parameter
*/
private String[] descriptors;
@@ -151,55 +149,55 @@ implements AssemblerConfigurationSource
/**
* A list of built-in descriptor references to generate from. You can select from <code>bin</code>,
* <code>jar-with-dependencies</code>, or <code>src</code>.
- *
+ *
* @parameter
*/
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
- * parameter.
- *
+ * 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
*/
private File archiveBaseDirectory;
/**
- * Predefined Assembly Descriptor Id's. You can select bin, jar-with-dependencies, or src.
- *
+ * Predefined Assembly Descriptor Id's. You can select bin, jar-with-dependencies, or src.
+ *
* @parameter expression="${descriptorId}"
* @deprecated Please use descriptorRefs instead
*/
+ @Deprecated
protected String descriptorId;
/**
- * Assembly XML Descriptor file. This must be the path to your customized descriptor file.
- *
+ * Assembly XML Descriptor file. This must be the path to your customized descriptor file.
+ *
* @parameter expression="${descriptor}"
* @deprecated Please use descriptors instead
*/
+ @Deprecated
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".
- *
+ * 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="${tarLongFileMode}" default-value="warn"
*/
private String tarLongFileMode;
/**
* Base directory of the project.
- *
+ *
* @parameter default-value="${basedir}"
* @required
* @readonly
@@ -208,21 +206,21 @@ implements AssemblerConfigurationSource
/**
* Maven ProjectHelper.
- *
+ *
* @component
*/
private MavenProjectHelper projectHelper;
/**
* Maven shared filtering utility.
- *
+ *
* @component
*/
private MavenFileFilter mavenFileFilter;
/**
* The Maven Session Object
- *
+ *
* @parameter expression="${session}"
* @required
* @readonly
@@ -231,7 +229,7 @@ implements AssemblerConfigurationSource
/**
* Temporary directory that contain the files to be assembled.
- *
+ *
* @parameter default-value="${project.build.directory}/archive-tmp"
* @required
* @readonly
@@ -240,7 +238,7 @@ implements AssemblerConfigurationSource
/**
* Directory for site generated.
- *
+ *
* @parameter default-value="${project.reporting.outputDirectory}"
* @readonly
*/
@@ -248,21 +246,23 @@ implements AssemblerConfigurationSource
/**
* 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
private boolean includeSite;
/**
* Set to false to exclude the assembly id from the assembly final name.
- *
+ *
* @parameter expression="${appendAssemblyId}" default-value="true"
*/
protected boolean appendAssemblyId;
/**
* Set to true in order to not fail when a descriptor is missing.
+ *
* @parameter expression="${ignoreMissingDescriptor}" default-value="false"
*/
protected boolean ignoreMissingDescriptor;
@@ -270,7 +270,7 @@ implements AssemblerConfigurationSource
/**
* 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
*/
private MavenArchiveConfiguration archive;
@@ -278,12 +278,11 @@ implements AssemblerConfigurationSource
/**
* @parameter
*/
- protected List filters;
+ protected List<String> filters;
/**
- * Controls whether the assembly plugin tries to attach the resulting
- * assembly to the project.
- *
+ * Controls whether the assembly plugin tries to attach the resulting assembly to the project.
+ *
* @parameter expression="${attach}" default-value="true"
* @since 2.2-beta-1
*/
@@ -300,26 +299,25 @@ implements AssemblerConfigurationSource
private AssemblyReader assemblyReader;
/**
- * Allows additional configuration options that are specific to a particular
- * type of archive format. This is intended to capture an XML configuration
- * that will be used to reflectively setup the options on the archiver 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/>
+ * Allows additional configuration options that are specific to a particular type of archive format. This is
+ * intended to capture an XML configuration that will be used to reflectively setup the options on the archiver
+ * 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/>
+ *
* <pre>
* <appxml>${project.basedir}/somepath/app.xml</appxml>
* </pre>
- *
+ *
* @parameter
* @since 2.2-beta-3
*/
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.
+ * 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="${runOnlyAtExecutionRoot}" default-value="false"
* @since 2.2-beta-4
*/
@@ -327,12 +325,11 @@ implements AssemblerConfigurationSource
/**
* Create the binary distribution.
- *
+ *
* @throws org.apache.maven.plugin.MojoExecutionException
- *
+ *
*/
- public void execute()
- throws MojoExecutionException, MojoFailureException
+ public void execute() throws MojoExecutionException, MojoFailureException
{
if ( skipAssembly )
{
@@ -340,47 +337,47 @@ implements AssemblerConfigurationSource
return;
}
- //run only at the execution root.
- if (runOnlyAtExecutionRoot && !isThisTheExecutionRoot())
+ // run only at the execution root.
+ if ( runOnlyAtExecutionRoot && !isThisTheExecutionRoot() )
{
getLog().info( "Skipping the assembly in this project because it's not the Execution Root" );
return;
}
- List assemblies;
+ List<Assembly> assemblies;
try
{
assemblies = assemblyReader.readAssemblies( this );
}
- catch ( AssemblyReadException e )
+ catch ( final AssemblyReadException e )
{
throw new MojoExecutionException( "Error reading assemblies: " + e.getMessage(), e );
}
- catch ( InvalidAssemblerConfigurationException e )
+ catch ( final InvalidAssemblerConfigurationException e )
{
- throw new MojoFailureException( assemblyReader, e.getMessage(), "Mojo configuration is invalid: " + e.getMessage() );
+ throw new MojoFailureException( assemblyReader, e.getMessage(), "Mojo configuration is invalid: "
+ + e.getMessage() );
}
// TODO: include dependencies marked for distribution under certain formats
// TODO: how, might we plug this into an installer, such as NSIS?
boolean warnedAboutMainProjectArtifact = false;
- for ( Iterator assemblyIterator = assemblies.iterator(); assemblyIterator.hasNext(); )
+ for ( final Iterator<Assembly> assemblyIterator = assemblies.iterator(); assemblyIterator.hasNext(); )
{
- Assembly assembly = (Assembly) assemblyIterator.next();
+ final Assembly assembly = assemblyIterator.next();
try
{
- String fullName = AssemblyFormatUtils.getDistributionName( assembly, this );
+ final String fullName = AssemblyFormatUtils.getDistributionName( assembly, this );
- for ( Iterator formatIterator = assembly.getFormats().iterator(); formatIterator.hasNext(); )
+ for ( final String format : assembly.getFormats() )
{
- String format = (String) formatIterator.next();
+ final File destFile = assemblyArchiver.createArchive( assembly, fullName, format, this );
- File destFile = assemblyArchiver.createArchive( assembly, fullName, format, this );
-
- MavenProject project = getProject();
- String classifier = getClassifier();
- String type = project.getArtifact().getType();
+ final MavenProject project = getProject();
+ final String classifier = getClassifier();
+ final String type = project.getArtifact()
+ .getType();
if ( attach && destFile.isFile() )
{
@@ -396,23 +393,28 @@ implements AssemblerConfigurationSource
{
if ( !warnedAboutMainProjectArtifact )
{
- StringBuffer message = new StringBuffer();
+ final StringBuffer message = new StringBuffer();
message.append( "Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing." );
- message.append( "\nInstead of attaching the assembly file: " ).append( destFile ).append( ", it will become the file for main project artifact." );
+ message.append( "\nInstead of attaching the assembly file: " )
+ .append( destFile )
+ .append( ", it will become the file for main project artifact." );
message.append( "\nNOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!" );
getLog().warn( message );
warnedAboutMainProjectArtifact = true;
}
- File existingFile = project.getArtifact().getFile();
+ final File existingFile = project.getArtifact()
+ .getFile();
if ( ( existingFile != null ) && existingFile.exists() )
{
- getLog().warn( "Replacing pre-existing project main-artifact file: " + existingFile + "\nwith assembly file: " + destFile );
+ getLog().warn( "Replacing pre-existing project main-artifact file: " + existingFile
+ + "\nwith assembly file: " + destFile );
}
- project.getArtifact().setFile( destFile );
+ project.getArtifact()
+ .setFile( destFile );
}
else
{
@@ -421,37 +423,42 @@ implements AssemblerConfigurationSource
}
else if ( attach )
{
- getLog().warn( "Assembly file: " + destFile + " is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment." );
+ getLog().warn( "Assembly file: "
+ + destFile
+ + " is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment." );
}
}
}
- catch ( ArchiveCreationException e )
+ catch ( final ArchiveCreationException e )
{
throw new MojoExecutionException( "Failed to create assembly: " + e.getMessage(), e );
}
- catch ( AssemblyFormattingException e )
+ catch ( final AssemblyFormattingException e )
{
throw new MojoExecutionException( "Failed to create assembly: " + e.getMessage(), e );
}
- catch ( InvalidAssemblerConfigurationException e )
+ catch ( final InvalidAssemblerConfigurationException e )
{
- throw new MojoFailureException( assembly, "Assembly is incorrectly configured: " + assembly.getId(), "Assembly: "
- + assembly.getId() + " is not configured correctly: " + e.getMessage() );
+ throw new MojoFailureException( assembly, "Assembly is incorrectly configured: " + assembly.getId(),
+ "Assembly: " + assembly.getId() + " is not configured correctly: "
+ + e.getMessage() );
}
}
}
/**
* Returns true if the current project is located at the Execution Root Directory (where mvn was launched)
+ *
* @return
*/
protected boolean isThisTheExecutionRoot()
{
- Log log = this.getLog();
- log.debug("Root Folder:" + mavenSession.getExecutionRootDirectory());
- log.debug("Current Folder:"+ basedir );
- boolean result = mavenSession.getExecutionRootDirectory().equalsIgnoreCase(basedir.toString());
- if (result)
+ final Log log = getLog();
+ log.debug( "Root Folder:" + mavenSession.getExecutionRootDirectory() );
+ log.debug( "Current Folder:" + basedir );
+ final boolean result = mavenSession.getExecutionRootDirectory()
+ .equalsIgnoreCase( basedir.toString() );
+ if ( result )
{
log.debug( "This is the execution root." );
}
@@ -560,20 +567,21 @@ implements AssemblerConfigurationSource
return archiveBaseDirectory;
}
- public List getFilters()
+ public List<String> getFilters()
{
if ( filters == null )
{
- filters = getProject().getBuild().getFilters();
+ filters = getProject().getBuild()
+ .getFilters();
if ( filters == null )
{
- filters = Collections.EMPTY_LIST;
+ filters = Collections.emptyList();
}
}
return filters;
}
- public List getReactorProjects()
+ public List<MavenProject> getReactorProjects()
{
return reactorProjects;
}
@@ -589,122 +597,122 @@ implements AssemblerConfigurationSource
return projectHelper;
}
- public void setAppendAssemblyId( boolean appendAssemblyId )
+ public void setAppendAssemblyId( final boolean appendAssemblyId )
{
this.appendAssemblyId = appendAssemblyId;
}
- public void setArchive( MavenArchiveConfiguration archive )
+ public void setArchive( final MavenArchiveConfiguration archive )
{
this.archive = archive;
}
- public void setArchiveBaseDirectory( File archiveBaseDirectory )
+ public void setArchiveBaseDirectory( final File archiveBaseDirectory )
{
this.archiveBaseDirectory = archiveBaseDirectory;
}
- public void setAssemblyArchiver( AssemblyArchiver assemblyArchiver )
+ public void setAssemblyArchiver( final AssemblyArchiver assemblyArchiver )
{
this.assemblyArchiver = assemblyArchiver;
}
- public void setAssemblyReader( AssemblyReader assemblyReader )
+ public void setAssemblyReader( final AssemblyReader assemblyReader )
{
this.assemblyReader = assemblyReader;
}
- public void setBasedir( File basedir )
+ public void setBasedir( final File basedir )
{
this.basedir = basedir;
}
- public void setClassifier( String classifier )
+ public void setClassifier( final String classifier )
{
this.classifier = classifier;
}
- public void setDescriptor( String descriptor )
+ public void setDescriptor( final String descriptor )
{
this.descriptor = descriptor;
}
- public void setDescriptorId( String descriptorId )
+ public void setDescriptorId( final String descriptorId )
{
this.descriptorId = descriptorId;
}
- public void setDescriptorRefs( String[] descriptorRefs )
+ public void setDescriptorRefs( final String[] descriptorRefs )
{
this.descriptorRefs = descriptorRefs;
}
- public void setDescriptors( String[] descriptors )
+ public void setDescriptors( final String[] descriptors )
{
this.descriptors = descriptors;
}
- public void setDescriptorSourceDirectory( File descriptorSourceDirectory )
+ public void setDescriptorSourceDirectory( final File descriptorSourceDirectory )
{
this.descriptorSourceDirectory = descriptorSourceDirectory;
}
- public void setFilters( List filters )
+ public void setFilters( final List<String> filters )
{
this.filters = filters;
}
- public void setFinalName( String finalName )
+ public void setFinalName( final String finalName )
{
this.finalName = finalName;
}
- public void setIncludeSite( boolean includeSite )
+ public void setIncludeSite( final boolean includeSite )
{
this.includeSite = includeSite;
}
- public void setLocalRepository( ArtifactRepository localRepository )
+ public void setLocalRepository( final ArtifactRepository localRepository )
{
this.localRepository = localRepository;
}
- public void setOutputDirectory( File outputDirectory )
+ public void setOutputDirectory( final File outputDirectory )
{
this.outputDirectory = outputDirectory;
}
- public void setProjectHelper( MavenProjectHelper projectHelper )
+ public void setProjectHelper( final MavenProjectHelper projectHelper )
{
this.projectHelper = projectHelper;
}
- public void setReactorProjects( List reactorProjects )
+ public void setReactorProjects( final List<MavenProject> reactorProjects )
{
this.reactorProjects = reactorProjects;
}
- public void setSiteDirectory( File siteDirectory )
+ public void setSiteDirectory( final File siteDirectory )
{
this.siteDirectory = siteDirectory;
}
- public void setTarLongFileMode( String tarLongFileMode )
+ public void setTarLongFileMode( final String tarLongFileMode )
{
this.tarLongFileMode = tarLongFileMode;
}
- public void setTempRoot( File tempRoot )
+ public void setTempRoot( final File tempRoot )
{
this.tempRoot = tempRoot;
}
- public void setWorkDirectory( File workDirectory )
+ public void setWorkDirectory( final File workDirectory )
{
this.workDirectory = workDirectory;
}
- public List getRemoteRepositories()
+ public List<ArtifactRepository> getRemoteRepositories()
{
return remoteRepositories;
}
@@ -719,16 +727,19 @@ implements AssemblerConfigurationSource
return ignoreDirFormatExtensions;
}
- public boolean isIgnoreMissingDescriptor() {
+ public boolean isIgnoreMissingDescriptor()
+ {
return ignoreMissingDescriptor;
}
- public void setIgnoreMissingDescriptor(boolean ignoreMissingDescriptor) {
+ public void setIgnoreMissingDescriptor( final boolean ignoreMissingDescriptor )
+ {
this.ignoreMissingDescriptor = ignoreMissingDescriptor;
}
- public MavenSession getMavenSession() {
- return this.mavenSession;
+ public MavenSession getMavenSession()
+ {
+ return mavenSession;
}
public String getArchiverConfig()
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=999612&r1=999611&r2=999612&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:34:50 2010
@@ -38,36 +38,35 @@ import java.util.List;
public abstract class AbstractDirectoryMojo
extends AbstractAssemblyMojo
{
- public void execute()
- throws MojoExecutionException, MojoFailureException
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException
{
- AssemblyReader reader = getAssemblyReader();
+ final AssemblyReader reader = getAssemblyReader();
- List assemblies;
+ List<Assembly> assemblies;
try
{
assemblies = reader.readAssemblies( this );
}
- catch ( AssemblyReadException e )
+ catch ( final AssemblyReadException e )
{
throw new MojoExecutionException( "Error reading assembly descriptors: " + e.getMessage(), e );
}
- catch ( InvalidAssemblerConfigurationException e )
+ catch ( final InvalidAssemblerConfigurationException e )
{
throw new MojoFailureException( reader, e.getMessage(), "Mojo configuration is invalid: " + e.getMessage() );
}
- for ( Iterator i = assemblies.iterator(); i.hasNext(); )
+ for ( final Iterator<Assembly> i = assemblies.iterator(); i.hasNext(); )
{
- Assembly assembly = ( Assembly ) i.next();
+ final Assembly assembly = i.next();
createDirectory( assembly );
}
}
- private void createDirectory( Assembly assembly )
- throws MojoExecutionException, MojoFailureException
+ private void createDirectory( final Assembly assembly ) throws MojoExecutionException, MojoFailureException
{
- AssemblyArchiver archiver = getAssemblyArchiver();
+ final AssemblyArchiver archiver = getAssemblyArchiver();
String fullName = getFinalName();
@@ -84,18 +83,19 @@ public abstract class AbstractDirectoryM
{
archiver.createArchive( assembly, fullName, "dir", this );
}
- catch ( ArchiveCreationException e )
+ catch ( final ArchiveCreationException e )
{
throw new MojoExecutionException( "Error creating assembly: " + e.getMessage(), e );
}
- catch ( AssemblyFormattingException e )
+ catch ( final AssemblyFormattingException e )
{
throw new MojoExecutionException( "Error creating assembly: " + e.getMessage(), e );
}
- catch ( InvalidAssemblerConfigurationException e )
+ catch ( final InvalidAssemblerConfigurationException e )
{
- throw new MojoFailureException( assembly, "Assembly is incorrectly configured: " + assembly.getId(), "Assembly: "
- + assembly.getId() + " is not configured correctly: " + e.getMessage() );
+ throw new MojoFailureException( assembly, "Assembly is incorrectly configured: " + assembly.getId(),
+ "Assembly: " + assembly.getId() + " is not configured correctly: "
+ + e.getMessage() );
}
}
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=999612&r1=999611&r2=999612&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:34:50 2010
@@ -19,11 +19,6 @@ package org.apache.maven.plugin.assembly
* under the License.
*/
-import java.io.File;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
@@ -34,14 +29,20 @@ import org.apache.maven.project.MavenPro
import org.codehaus.plexus.archiver.manager.ArchiverManager;
import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
+import java.io.File;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
/**
- * Unpack project dependencies. Currently supports dependencies of type jar and zip.
- *
+ * Unpack project dependencies. Currently supports dependencies of type jar and zip.
+ *
* @version $Id$
* @goal unpack
* @requiresDependencyResolution test
* @deprecated Use org.apache.maven.plugins:maven-dependency-plugin goal: unpack or unpack-dependencies instead.
*/
+@Deprecated
public class UnpackMojo
extends AbstractMojo
{
@@ -60,7 +61,7 @@ public class UnpackMojo
/**
* Directory to unpack JARs into if needed
- *
+ *
* @parameter expression="${project.build.directory}/assembly/work"
* @required
*/
@@ -68,55 +69,58 @@ public class UnpackMojo
/**
* Unpacks the archive file.
- *
+ *
* @throws MojoExecutionException
*/
- public void execute()
- throws MojoExecutionException, MojoFailureException
+ public void execute() throws MojoExecutionException, MojoFailureException
{
- Set dependencies = new HashSet();
+ final Set<Artifact> dependencies = new HashSet<Artifact>();
- if ( project.getArtifact() != null && project.getArtifact().getFile() != null )
+ if ( project.getArtifact() != null && project.getArtifact()
+ .getFile() != null )
{
dependencies.add( project.getArtifact() );
}
- Set projectArtifacts = project.getArtifacts();
+ @SuppressWarnings( "unchecked" )
+ final Set<Artifact> projectArtifacts = project.getArtifacts();
if ( projectArtifacts != null )
{
dependencies.addAll( projectArtifacts );
}
- for ( Iterator j = dependencies.iterator(); j.hasNext(); )
+ for ( final Iterator<Artifact> j = dependencies.iterator(); j.hasNext(); )
{
- Artifact artifact = (Artifact) j.next();
+ final Artifact artifact = j.next();
- String name = artifact.getFile().getName();
+ final String name = artifact.getFile()
+ .getName();
- File tempLocation = new File( workDirectory, name.substring( 0, name.lastIndexOf( '.' ) ) );
+ final File tempLocation = new File( workDirectory, name.substring( 0, name.lastIndexOf( '.' ) ) );
boolean process = false;
if ( !tempLocation.exists() )
{
tempLocation.mkdirs();
process = true;
}
- else if ( artifact.getFile().lastModified() > tempLocation.lastModified() )
+ else if ( artifact.getFile()
+ .lastModified() > tempLocation.lastModified() )
{
process = true;
}
if ( process )
{
- File file = artifact.getFile();
+ final File file = artifact.getFile();
try
{
AssemblyFileUtils.unpack( file, tempLocation, archiverManager );
}
- catch ( NoSuchArchiverException e )
+ catch ( final NoSuchArchiverException e )
{
- this.getLog().info( "Skip unpacking dependency file with unknown extension: " + file.getPath() );
+ getLog().info( "Skip unpacking dependency file with unknown extension: " + file.getPath() );
}
- catch ( ArchiveExpansionException e )
+ catch ( final ArchiveExpansionException e )
{
throw new MojoExecutionException( "Error unpacking dependency file: " + file, e );
}
@@ -124,5 +128,4 @@ public class UnpackMojo
}
}
-
}
\ No newline at end of file
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/utils/FilterUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/utils/FilterUtils.java?rev=999612&r1=999611&r2=999612&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/utils/FilterUtils.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/utils/FilterUtils.java Tue Sep 21 20:34:50 2010
@@ -19,12 +19,6 @@ package org.apache.maven.plugin.assembly
* under the License.
*/
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
@@ -35,6 +29,12 @@ import org.apache.maven.shared.artifact.
import org.apache.maven.shared.artifact.filter.StatisticsReportingArtifactFilter;
import org.codehaus.plexus.logging.Logger;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
/**
* @version $Id$
*/
@@ -45,34 +45,34 @@ public final class FilterUtils
{
}
- public static void filterProjects( Set projects, List includes, List excludes, boolean actTransitively,
- Logger logger )
+ public static void filterProjects( final Set<MavenProject> projects, final List<String> includes,
+ final List<String> excludes, final boolean actTransitively, final Logger logger )
{
- List allFilters = new ArrayList();
+ final List<PatternIncludesArtifactFilter> allFilters = new ArrayList<PatternIncludesArtifactFilter>();
- AndArtifactFilter filter = new AndArtifactFilter();
+ final AndArtifactFilter filter = new AndArtifactFilter();
if ( !includes.isEmpty() )
{
- PatternIncludesArtifactFilter includeFilter = new PatternIncludesArtifactFilter( includes,
- actTransitively );
+ final PatternIncludesArtifactFilter includeFilter =
+ new PatternIncludesArtifactFilter( includes, actTransitively );
filter.add( includeFilter );
allFilters.add( includeFilter );
}
if ( !excludes.isEmpty() )
{
- PatternExcludesArtifactFilter excludeFilter = new PatternExcludesArtifactFilter( excludes,
- actTransitively );
+ final PatternExcludesArtifactFilter excludeFilter =
+ new PatternExcludesArtifactFilter( excludes, actTransitively );
filter.add( excludeFilter );
allFilters.add( excludeFilter );
}
- for ( Iterator it = projects.iterator(); it.hasNext(); )
+ for ( final Iterator<MavenProject> it = projects.iterator(); it.hasNext(); )
{
- MavenProject project = (MavenProject) it.next();
- Artifact artifact = project.getArtifact();
+ final MavenProject project = it.next();
+ final Artifact artifact = project.getArtifact();
if ( !filter.include( artifact ) )
{
@@ -80,9 +80,9 @@ public final class FilterUtils
}
}
- for ( Iterator it = allFilters.iterator(); it.hasNext(); )
+ for ( final Iterator<PatternIncludesArtifactFilter> it = allFilters.iterator(); it.hasNext(); )
{
- ArtifactFilter f = (ArtifactFilter) it.next();
+ final ArtifactFilter f = it.next();
if ( f instanceof StatisticsReportingArtifactFilter )
{
@@ -91,27 +91,30 @@ public final class FilterUtils
}
}
- public static void filterArtifacts( Set artifacts, List includes, List excludes, boolean strictFiltering,
- boolean actTransitively, List additionalFilters, Logger logger )
+ public static void filterArtifacts( final Set<Artifact> artifacts, final List<String> includes,
+ final List<String> excludes, final boolean strictFiltering,
+ final boolean actTransitively, final Logger logger,
+ final ArtifactFilter... additionalFilters )
throws InvalidAssemblerConfigurationException
{
- List allFilters = new ArrayList();
+ final List<ArtifactFilter> allFilters = new ArrayList<ArtifactFilter>();
- AndArtifactFilter filter = new AndArtifactFilter();
+ final AndArtifactFilter filter = new AndArtifactFilter();
- if ( additionalFilters != null && !additionalFilters.isEmpty() )
+ if ( additionalFilters != null && additionalFilters.length > 0 )
{
- for ( Iterator it = additionalFilters.iterator(); it.hasNext(); )
+ for ( final ArtifactFilter additionalFilter : additionalFilters )
{
- ArtifactFilter additionalFilter = (ArtifactFilter) it.next();
-
- filter.add( additionalFilter );
+ if ( additionalFilter != null )
+ {
+ filter.add( additionalFilter );
+ }
}
}
if ( !includes.isEmpty() )
{
- ArtifactFilter includeFilter = new PatternIncludesArtifactFilter( includes, actTransitively );
+ final ArtifactFilter includeFilter = new PatternIncludesArtifactFilter( includes, actTransitively );
filter.add( includeFilter );
@@ -120,21 +123,22 @@ public final class FilterUtils
if ( !excludes.isEmpty() )
{
- ArtifactFilter excludeFilter = new PatternExcludesArtifactFilter( excludes, actTransitively );
+ final ArtifactFilter excludeFilter = new PatternExcludesArtifactFilter( excludes, actTransitively );
filter.add( excludeFilter );
allFilters.add( excludeFilter );
}
- if ( additionalFilters != null && !additionalFilters.isEmpty() )
- {
- allFilters.addAll( additionalFilters );
- }
+ // FIXME: Why is this added twice??
+ // if ( additionalFilters != null && !additionalFilters.isEmpty() )
+ // {
+ // allFilters.addAll( additionalFilters );
+ // }
- for ( Iterator it = artifacts.iterator(); it.hasNext(); )
+ for ( final Iterator<Artifact> it = artifacts.iterator(); it.hasNext(); )
{
- Artifact artifact = (Artifact) it.next();
+ final Artifact artifact = it.next();
if ( !filter.include( artifact ) )
{
@@ -149,13 +153,13 @@ public final class FilterUtils
reportFilteringStatistics( allFilters, logger );
- for ( Iterator it = allFilters.iterator(); it.hasNext(); )
+ for ( final Iterator<ArtifactFilter> it = allFilters.iterator(); it.hasNext(); )
{
- ArtifactFilter f = (ArtifactFilter) it.next();
+ final ArtifactFilter f = it.next();
if ( f instanceof StatisticsReportingArtifactFilter )
{
- StatisticsReportingArtifactFilter sFilter = (StatisticsReportingArtifactFilter) f;
+ final StatisticsReportingArtifactFilter sFilter = (StatisticsReportingArtifactFilter) f;
if ( strictFiltering && sFilter.hasMissedCriteria() )
{
@@ -166,15 +170,15 @@ public final class FilterUtils
}
}
- public static void reportFilteringStatistics( Collection filters, Logger logger )
+ public static void reportFilteringStatistics( final Collection<ArtifactFilter> filters, final Logger logger )
{
- for ( Iterator it = filters.iterator(); it.hasNext(); )
+ for ( final Iterator<ArtifactFilter> it = filters.iterator(); it.hasNext(); )
{
- ArtifactFilter f = (ArtifactFilter) it.next();
+ final ArtifactFilter f = it.next();
if ( f instanceof StatisticsReportingArtifactFilter )
{
- StatisticsReportingArtifactFilter sFilter = (StatisticsReportingArtifactFilter) f;
+ final StatisticsReportingArtifactFilter sFilter = (StatisticsReportingArtifactFilter) f;
if ( logger.isDebugEnabled() )
{
Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/utils/InterpolationConstants.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/utils/InterpolationConstants.java?rev=999612&r1=999611&r2=999612&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/utils/InterpolationConstants.java (original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/utils/InterpolationConstants.java Tue Sep 21 20:34:50 2010
@@ -6,24 +6,24 @@ import java.util.List;
public final class InterpolationConstants
{
-
- public static final List PROJECT_PREFIXES;
-
- public static final List PROJECT_PROPERTIES_PREFIXES;
-
+
+ public static final List<String> PROJECT_PREFIXES;
+
+ public static final List<String> PROJECT_PROPERTIES_PREFIXES;
+
static
{
- List projectPrefixes = new ArrayList();
+ final List<String> projectPrefixes = new ArrayList<String>();
projectPrefixes.add( "pom." );
projectPrefixes.add( "project." );
-
+
PROJECT_PREFIXES = Collections.unmodifiableList( projectPrefixes );
-
- List projectPropertiesPrefixes = new ArrayList();
-
+
+ final List<String> projectPropertiesPrefixes = new ArrayList<String>();
+
projectPropertiesPrefixes.add( "pom.properties." );
projectPropertiesPrefixes.add( "project.properties." );
-
+
PROJECT_PROPERTIES_PREFIXES = Collections.unmodifiableList( projectPropertiesPrefixes );
}