brett 2005/03/18 15:32:37
Modified: maven-core/src/main/java/org/apache/maven/plugin
DefaultPluginManager.java
Log:
make sure paths are processed after plugin configuration is merged
Revision Changes Path
1.55 +40 -44
maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
Index: DefaultPluginManager.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- DefaultPluginManager.java 17 Mar 2005 02:04:35 -0000 1.54
+++ DefaultPluginManager.java 18 Mar 2005 23:32:37 -0000 1.55
@@ -459,49 +459,36 @@
public Map createParameters( MojoDescriptor goal, MavenSession session )
throws PluginConfigurationException
{
- Map map = null;
-
List parameters = goal.getParameters();
- if ( parameters != null )
- {
- map = new HashMap();
-
- for ( int i = 0; i < parameters.size(); i++ )
- {
- Parameter parameter = (Parameter) parameters.get( i );
+ Map map = new HashMap();
- String key = parameter.getName();
-
- String expression = parameter.getExpression();
+ for ( int i = 0; i < parameters.size(); i++ )
+ {
+ Parameter parameter = (Parameter) parameters.get( i );
- Object value = PluginParameterExpressionEvaluator.evaluate(
expression, session );
+ String key = parameter.getName();
- getLogger().debug( "Evaluated mojo parameter expression: \'"
+ expression + "\' to: " + value );
+ String expression = parameter.getExpression();
- if ( value == null )
- {
- if ( parameter.getDefaultValue() != null )
- {
- value = PluginParameterExpressionEvaluator.evaluate(
parameter.getDefaultValue(), session );
- }
- }
+ Object value = PluginParameterExpressionEvaluator.evaluate(
expression, session );
- String type = parameter.getType();
+ getLogger().debug( "Evaluated mojo parameter expression: \'" +
expression + "\' to: " + value );
- if ( type != null && ( type.equals( "File" ) || type.equals(
"java.io.File" ) ) )
+ if ( value == null )
+ {
+ if ( parameter.getDefaultValue() != null )
{
- value = pathTranslator.alignToBaseDirectory( (String)
value,
-
session.getProject().getFile().getParentFile() );
+ value = PluginParameterExpressionEvaluator.evaluate(
parameter.getDefaultValue(), session );
}
-
- map.put( key, value );
}
- if ( session.getProject() != null )
- {
- map = mergeProjectDefinedPluginConfiguration(
session.getProject(), goal.getId(), map );
- }
+ map.put( key, value );
+ }
+
+ if ( session.getProject() != null )
+ {
+ map = mergeProjectDefinedPluginConfiguration(
session.getProject(), goal.getId(), map );
}
for ( int i = 0; i < parameters.size(); i++ )
@@ -525,6 +512,15 @@
{
throw new PluginConfigurationException(
createPluginParameterRequiredMessage( goal, parameter ) );
}
+
+ String type = parameter.getType();
+
+ if ( type != null && ( type.equals( "File" ) || type.equals(
"java.io.File" ) ) )
+ {
+ value = pathTranslator.alignToBaseDirectory( (String) value,
+
session.getProject().getFile().getParentFile() );
+ map.put( key, value );
+ }
}
return map;
@@ -546,7 +542,7 @@
{
org.apache.maven.model.Plugin plugin =
(org.apache.maven.model.Plugin) iterator.next();
- // TODO: groupID not handled
+// TODO: groupID not handled
if ( pluginId.equals( plugin.getArtifactId() ) )
{
return CollectionUtils.mergeMaps(
plugin.getConfiguration(), map );
@@ -567,9 +563,9 @@
return message.toString();
}
- // ----------------------------------------------------------------------
- // Lifecycle
- // ----------------------------------------------------------------------
+// ----------------------------------------------------------------------
+// Lifecycle
+// ----------------------------------------------------------------------
public void contextualize( Context context )
throws ContextException
@@ -586,11 +582,11 @@
"plexus-artifact-container", "wagon-provider-api",
"classworlds"}
);
- // TODO: move this to be configurable from the Maven component
+// TODO: move this to be configurable from the Maven component
remotePluginRepositories = new ArrayList();
- // TODO: needs to be configured from the POM element
-
+// TODO: needs to be configured from the POM element
+
MavenSettings settings = null;
try
{
@@ -611,9 +607,9 @@
remotePluginRepositories.add( pluginRepository );
}
- // ----------------------------------------------------------------------
- // Artifact resolution
- // ----------------------------------------------------------------------
+// ----------------------------------------------------------------------
+// Artifact resolution
+// ----------------------------------------------------------------------
private void resolveTransitiveDependencies( MavenSession context,
ArtifactResolver artifactResolver,
MavenProjectBuilder
mavenProjectBuilder )
@@ -631,9 +627,9 @@
project.addArtifacts( result.getArtifacts().values() );
}
- // ----------------------------------------------------------------------
- // Artifact downloading
- // ----------------------------------------------------------------------
+// ----------------------------------------------------------------------
+// Artifact downloading
+// ----------------------------------------------------------------------
private void downloadDependencies( MavenSession context,
ArtifactResolver artifactResolver )
throws GoalExecutionException