You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/05/04 03:08:41 UTC
svn commit: r771154 - in
/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven:
lifecycle/DefaultLifecycleExecutor.java
project/DefaultMavenProjectBuilder.java
Author: bentmann
Date: Mon May 4 01:08:40 2009
New Revision: 771154
URL: http://svn.apache.org/viewvc?rev=771154&view=rev
Log:
o Fixed merging of lifecycle plugins that contribute more than one execution
o Fixed conversion of default value for plugin configuration
Modified:
maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=771154&r1=771153&r2=771154&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java (original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java Mon May 4 01:08:40 2009
@@ -18,10 +18,10 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -508,7 +508,7 @@
//
public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging )
{
- Set<Plugin> plugins = new LinkedHashSet<Plugin>();
+ Map<Plugin, Plugin> plugins = new LinkedHashMap<Plugin, Plugin>();
for ( Lifecycle lifecycle : lifecycles )
{
@@ -524,23 +524,35 @@
//
// org.apache.maven.plugins:maven-compiler-plugin:compile
//
- for ( String s : lifecyclePhasesForPackaging.values() )
- {
- plugins.add( populatePluginWithInformationSpecifiedInLifecyclePhaseDefinition( s ) );
- }
+ parseLifecyclePhaseDefinitions( plugins, lifecyclePhasesForPackaging.values() );
}
else if ( lifecycle.getDefaultPhases() != null )
{
- for ( String s : lifecycle.getDefaultPhases() )
- {
- plugins.add( populatePluginWithInformationSpecifiedInLifecyclePhaseDefinition( s ) );
- }
+ parseLifecyclePhaseDefinitions( plugins, lifecycle.getDefaultPhases() );
}
}
- return plugins;
+ return plugins.keySet();
}
-
+
+ private void parseLifecyclePhaseDefinitions( Map<Plugin, Plugin> plugins,
+ Collection<String> lifecyclePhaseDefinitions )
+ {
+ for ( String lifecyclePhaseDefinition : lifecyclePhaseDefinitions )
+ {
+ Plugin plugin = populatePluginWithInformationSpecifiedInLifecyclePhaseDefinition( lifecyclePhaseDefinition );
+ Plugin existing = plugins.get( plugin );
+ if ( existing != null )
+ {
+ existing.getExecutions().addAll( plugin.getExecutions() );
+ }
+ else
+ {
+ plugins.put( plugin, plugin );
+ }
+ }
+ }
+
private Plugin populatePluginWithInformationSpecifiedInLifecyclePhaseDefinition( String lifecyclePhaseDefinition )
{
String[] p = StringUtils.split( lifecyclePhaseDefinition, ":" );
@@ -548,8 +560,10 @@
plugin.setGroupId( p[0] );
plugin.setArtifactId( p[1] );
PluginExecution execution = new PluginExecution();
- execution.setGoals( Arrays.asList( new String[]{ p[2] } ) );
- plugin.setExecutions( Arrays.asList( new PluginExecution[]{ execution } ) );
+ // FIXME: Find a better execution id
+ execution.setId( "default-" + p[2] );
+ execution.setGoals( new ArrayList<String>( Arrays.asList( new String[] { p[2] } ) ) );
+ plugin.setExecutions( new ArrayList<PluginExecution>( Arrays.asList( new PluginExecution[] { execution } ) ) );
return plugin;
}
@@ -563,7 +577,7 @@
for( String g : e.getGoals() )
{
Xpp3Dom dom = getDefaultPluginConfiguration( p.getGroupId(), p.getArtifactId(), p.getVersion(), g, project, localRepository );
- e.setConfiguration( dom );
+ e.setConfiguration( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) e.getConfiguration(), dom, Boolean.TRUE ) );
}
}
}
@@ -594,11 +608,11 @@
for( PlexusConfiguration ce : ces )
{
- if ( ce.getValue( null ) != null )
+ String defaultValue = ce.getAttribute( "default-value", null );
+ if ( ce.getValue( null ) != null || defaultValue != null )
{
Xpp3Dom e = new Xpp3Dom( ce.getName() );
e.setValue( ce.getValue( null ) );
- String defaultValue = ce.getAttribute( "default-value", null );
if ( defaultValue != null )
{
e.setAttribute( "default-value", defaultValue );
Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=771154&r1=771153&r2=771154&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java (original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java Mon May 4 01:08:40 2009
@@ -191,7 +191,7 @@
pln.add(copy);
}
- // Merge the various sources for mojo configuration:
+ // Merge the various sources for mojo configuration:
// 1. default values from mojo descriptor
// 2. POM values from per-plugin configuration
// 3. POM values from per-execution configuration
@@ -280,7 +280,7 @@
return null;
}
- public static void addPluginsToModel(Model target, Set<Plugin> plugins)
+ public static void addPluginsToModel( Model target, Set<Plugin> plugins )
{
List<Plugin> mngPlugins = (target.getBuild().getPluginManagement() != null)
? target.getBuild().getPluginManagement().getPlugins() : new ArrayList<Plugin>();
@@ -300,14 +300,19 @@
}
Plugin pomPlugin = containsPlugin( p, pomPlugins);
- if( pomPlugin == null)
- {
- lifecyclePlugins.add(p);
- }
- else if(p.getConfiguration() != null)
- {
- System.out.println(Xpp3Dom.mergeXpp3Dom((Xpp3Dom) p.getConfiguration(), (Xpp3Dom) pomPlugin.getConfiguration()));
- }
+ if ( pomPlugin == null )
+ {
+ lifecyclePlugins.add( p );
+ }
+ else
+ {
+ PluginProcessor.copy2( p, pomPlugin, true );
+ if ( p.getConfiguration() != null )
+ {
+ System.out.println( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) p.getConfiguration(),
+ (Xpp3Dom) pomPlugin.getConfiguration() ) );
+ }
+ }
}
pomPlugins.addAll(lifecyclePlugins);
target.getBuild().setPlugins(pomPlugins);
Re: svn commit: r771154 - in /maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven: lifecycle/DefaultLifecycleExecutor.java project/DefaultMavenProjectBuilder.java
Posted by Jason van Zyl <jv...@sonatype.com>.
On 4-May-09, at 7:50 AM, Benjamin Bentmann wrote:
> Jason van Zyl wrote:
>
>> We could also just go simple and spit out an XML document with all
>> the plugins in the default lifcycle with versions and
>> configurations. [...] I'm sure you can see the lack of symmetry in
>> having to synthesize execution elements for the model builder to
>> consume. They should just be there in full form.
>
> Kind of a mixin, sounds logical to me. Providing the default
> lifecycle executions in explicit form for consumption by the model
> builder should also
>
> a) Make the effective POM more expressive, i.e. with "mvn help:effective-pom
> " users would actually see what plugins execute by default, reducing
> some black-magic.
>
Yes, more what you see is what you get. It would also make joining the
elements easier because we won't have to do this synthesis along the
way.
> b) Ease configuration of default executions (MNG-3203). One issue we
> discussed in some length back ago was how to automatically derive a
> default execution id for those implicit executions [0]. But if we
> explicitly/manually define the lifecycle executions, a human
> (lifecycle developer) can carefully choose safe and user-friendly
> executions ids.
>
> The only downside of this approach that I see are executions with
> two or more goals which share some parameters with the same name but
> different default-values/expressions, e.g.
>
> <execution>
> <goals>
> <goal>foo</goal>
> <goal>bar</goal>
> </goals>
> </execution>
>
> and in FooMojo
>
> /**
> * @parameter default-value="foo"
> */
> private String someParameter;
>
> while in BarMojo
>
> /**
> * @parameter default-value="bar"
> */
> private String someParameter;
>
> AFAIK, the plugin manager in 2.x has no problems with this clash as
> it processes these default-values lately when configuring a single
> mojo just before its execution. However, when we pull the
> configuration from several mojo descriptors into the one
> <configuration> section of an <execution>, we need to decide how to
> handle this case (first-wins, last-wins, error, etc.)
>
Here we should just get more explicit and probably say one goal per
execution with its own configuration to just avoid any problems forever.
>> - the model builder should stand-alone to build fully inherited/
>> interpolated models
>> - the project builder should bring in any runtime information in
>> the form of properties, and really should be a very thin layer over
>> the model builder
>
> I assume this means we don't have the model builder interpolate once
> and then the project builder again with new properties. Otherwise,
> the first interpolation would wipe out any chance for runtime
> informatin like CLI/system/exection properties to override say stuff
> from the POM's <properties> section.
Right, this should only happen once. The project builder should really
do nothing but introduce runtime values for interpolation.
>
>
> Benjamin
>
>
> [0] http://docs.codehaus.org/display/MAVENUSER/Default+Plugin+Execution+IDs
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/SonatypeNexus
http://twitter.com/SonatypeM2E
----------------------------------------------------------
A language that doesn’t affect the way you think about programming is
not worth knowing.
-— Alan Perlis
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r771154 - in /maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven:
lifecycle/DefaultLifecycleExecutor.java project/DefaultMavenProjectBuilder.java
Posted by Benjamin Bentmann <be...@udo.edu>.
Jason van Zyl wrote:
> We could also just go simple and spit out an XML document with all the
> plugins in the default lifcycle with versions and configurations.
> [...] I'm sure you can see the lack of symmetry in
> having to synthesize execution elements for the model builder to
> consume. They should just be there in full form.
Kind of a mixin, sounds logical to me. Providing the default lifecycle
executions in explicit form for consumption by the model builder should also
a) Make the effective POM more expressive, i.e. with "mvn
help:effective-pom" users would actually see what plugins execute by
default, reducing some black-magic.
b) Ease configuration of default executions (MNG-3203). One issue we
discussed in some length back ago was how to automatically derive a
default execution id for those implicit executions [0]. But if we
explicitly/manually define the lifecycle executions, a human (lifecycle
developer) can carefully choose safe and user-friendly executions ids.
The only downside of this approach that I see are executions with two or
more goals which share some parameters with the same name but different
default-values/expressions, e.g.
<execution>
<goals>
<goal>foo</goal>
<goal>bar</goal>
</goals>
</execution>
and in FooMojo
/**
* @parameter default-value="foo"
*/
private String someParameter;
while in BarMojo
/**
* @parameter default-value="bar"
*/
private String someParameter;
AFAIK, the plugin manager in 2.x has no problems with this clash as it
processes these default-values lately when configuring a single mojo
just before its execution. However, when we pull the configuration from
several mojo descriptors into the one <configuration> section of an
<execution>, we need to decide how to handle this case (first-wins,
last-wins, error, etc.)
> - the model builder should stand-alone to build fully inherited/interpolated models
> - the project builder should bring in any runtime information in the form of properties, and really should be a very thin layer over the model builder
I assume this means we don't have the model builder interpolate once and
then the project builder again with new properties. Otherwise, the first
interpolation would wipe out any chance for runtime informatin like
CLI/system/exection properties to override say stuff from the POM's
<properties> section.
Benjamin
[0] http://docs.codehaus.org/display/MAVENUSER/Default+Plugin+Execution+IDs
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r771154 - in /maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven: lifecycle/DefaultLifecycleExecutor.java project/DefaultMavenProjectBuilder.java
Posted by Brett Porter <br...@apache.org>.
On 04/05/2009, at 1:47 PM, Jason van Zyl wrote:
> - the model builder should stand-alone to build fully inherited/
> interpolated models
> - the project builder should bring in any runtime information in the
> form of properties, and really should be a very thin layer over the
> model builder
+1
> - the lifecycle executor should calculate the build plan, and by
> this point every bit of configuration for each mojo should be
> calculated
> - the plugin manager does nothing except build up the class loader
> and execute the mojo with the already built up and fully validated
> configurations (i still don't like the expression evaluator which
> mixes composition and configuration but i'm still thinking about
> that one). you should not execute 4 of N plugins in your build plan
> and then find out a required parameter is missing. Every last bit
> needs to be know and made available to external tooling so that we
> could have real POM validation in m2eclipse and provide real help to
> correct the problems. only knowing while the plugins is executing is
> not good enough.
Agree in spirit, though likewise still thinking through the
implications, such as:
- the split between plugin config using default-value / expression vs
config supplied in the POM
- non ${project.} expressions
- values that might change during execution and need to be set "just
in time"
I think this was also some of the stuff John bumped up against where
interpolating too early with the 2.1.0 work.
Even if it's not entirely backwards compatible, it might be worth
starting to enforce complete separate of the configuration phase from
the execution phase - so anything that needs to be used during
execution would need to be done in the execute() method itself rather
than via an expression.
Something else that would help here is the ability for a mojo to
describe it's outputs in some way (the classic case of adding a
generated source directory) so that modifications could actually be
computed as part of the build plan.
Cheers,
Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: svn commit: r771154 - in /maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven: lifecycle/DefaultLifecycleExecutor.java project/DefaultMavenProjectBuilder.java
Posted by Jason van Zyl <jv...@sonatype.com>.
It's fine to fix this temporarily like this, but ultimately here I'm
just trying to give the project/model builder all the information it
needs and the merging of any bits should only be in the model builder.
Merging of any configuration should also definitely not happen in the
plugin manager. I realize there is some interplay between the model/
project builder and the lifecycle executor right now because we need
to deal with giving the model builder the correct default lifecycle
plugin information but this stuff all needs to find it's way back to
to the model/project builder.
It can go in the project builder for now and we'll figure out the
exact boundaries of the model versus project. For most consumers of
POMs they probably don't care about plugins, they want the dependency
information. So the model builder could be told to turn off the plugin
processor and therefore not require a component (whether that be the
lifecycle executor as it is now or something else).
We could also just go simple and spit out an XML document with all the
plugins in the default lifcycle with versions and configurations.
Include a copy of it with Maven for its use, and publish it to central
for use by the model builder if we wanted to provide a model builder
which truly could be any POM without requiring Maven's runtime. We
could just remove that configuration from the default lifecycle
executor component, which we really should do, and then this would
become an order of magnitude easier. I'm sure you can see the lack of
symmetry in having to synthesize execution elements for the model
builder to consume. They should just be there in full form.
- the model builder should stand-alone to build fully inherited/
interpolated models
- the project builder should bring in any runtime information in the
form of properties, and really should be a very thin layer over the
model builder
- the lifecycle executor should calculate the build plan, and by this
point every bit of configuration for each mojo should be calculated
- the plugin manager does nothing except build up the class loader and
execute the mojo with the already built up and fully validated
configurations (i still don't like the expression evaluator which
mixes composition and configuration but i'm still thinking about that
one). you should not execute 4 of N plugins in your build plan and
then find out a required parameter is missing. Every last bit needs to
be know and made available to external tooling so that we could have
real POM validation in m2eclipse and provide real help to correct the
problems. only knowing while the plugins is executing is not good
enough.
On 3-May-09, at 6:08 PM, bentmann@apache.org wrote:
> Author: bentmann
> Date: Mon May 4 01:08:40 2009
> New Revision: 771154
>
> URL: http://svn.apache.org/viewvc?rev=771154&view=rev
> Log:
> o Fixed merging of lifecycle plugins that contribute more than one
> execution
> o Fixed conversion of default value for plugin configuration
>
> Modified:
> maven/components/branches/MNG-2766/maven-core/src/main/java/org/
> apache/maven/lifecycle/DefaultLifecycleExecutor.java
> maven/components/branches/MNG-2766/maven-core/src/main/java/org/
> apache/maven/project/DefaultMavenProjectBuilder.java
>
> Modified: maven/components/branches/MNG-2766/maven-core/src/main/
> java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
> URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=771154&r1=771153&r2=771154&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- maven/components/branches/MNG-2766/maven-core/src/main/java/org/
> apache/maven/lifecycle/DefaultLifecycleExecutor.java (original)
> +++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/
> apache/maven/lifecycle/DefaultLifecycleExecutor.java Mon May 4
> 01:08:40 2009
> @@ -18,10 +18,10 @@
> import java.io.File;
> import java.util.ArrayList;
> import java.util.Arrays;
> +import java.util.Collection;
> import java.util.Collections;
> import java.util.HashMap;
> import java.util.LinkedHashMap;
> -import java.util.LinkedHashSet;
> import java.util.List;
> import java.util.Map;
> import java.util.Set;
> @@ -508,7 +508,7 @@
> //
> public Set<Plugin>
> getPluginsBoundByDefaultToAllLifecycles( String packaging )
> {
> - Set<Plugin> plugins = new LinkedHashSet<Plugin>();
> + Map<Plugin, Plugin> plugins = new LinkedHashMap<Plugin,
> Plugin>();
>
> for ( Lifecycle lifecycle : lifecycles )
> {
> @@ -524,23 +524,35 @@
> //
> // org.apache.maven.plugins:maven-compiler-
> plugin:compile
> //
> - for ( String s :
> lifecyclePhasesForPackaging.values() )
> - {
> -
> plugins
> .add
> ( populatePluginWithInformationSpecifiedInLifecyclePhaseDefinition
> ( s ) );
> - }
> + parseLifecyclePhaseDefinitions( plugins,
> lifecyclePhasesForPackaging.values() );
> }
> else if ( lifecycle.getDefaultPhases() != null )
> {
> - for ( String s : lifecycle.getDefaultPhases() )
> - {
> -
> plugins
> .add
> ( populatePluginWithInformationSpecifiedInLifecyclePhaseDefinition
> ( s ) );
> - }
> + parseLifecyclePhaseDefinitions( plugins,
> lifecycle.getDefaultPhases() );
> }
> }
>
> - return plugins;
> + return plugins.keySet();
> }
> -
> +
> + private void parseLifecyclePhaseDefinitions( Map<Plugin,
> Plugin> plugins,
> + Collection<String>
> lifecyclePhaseDefinitions )
> + {
> + for ( String lifecyclePhaseDefinition :
> lifecyclePhaseDefinitions )
> + {
> + Plugin plugin =
> populatePluginWithInformationSpecifiedInLifecyclePhaseDefinition
> ( lifecyclePhaseDefinition );
> + Plugin existing = plugins.get( plugin );
> + if ( existing != null )
> + {
> +
> existing.getExecutions().addAll( plugin.getExecutions() );
> + }
> + else
> + {
> + plugins.put( plugin, plugin );
> + }
> + }
> + }
> +
> private Plugin
> populatePluginWithInformationSpecifiedInLifecyclePhaseDefinition
> ( String lifecyclePhaseDefinition )
> {
> String[] p = StringUtils.split( lifecyclePhaseDefinition,
> ":" );
> @@ -548,8 +560,10 @@
> plugin.setGroupId( p[0] );
> plugin.setArtifactId( p[1] );
> PluginExecution execution = new PluginExecution();
> - execution.setGoals( Arrays.asList( new String[]{ p[2] } ) );
> - plugin.setExecutions( Arrays.asList( new PluginExecution[]
> { execution } ) );
> + // FIXME: Find a better execution id
> + execution.setId( "default-" + p[2] );
> + execution.setGoals( new
> ArrayList<String>( Arrays.asList( new String[] { p[2] } ) ) );
> + plugin.setExecutions( new
> ArrayList<PluginExecution>( Arrays.asList( new PluginExecution[]
> { execution } ) ) );
> return plugin;
> }
>
> @@ -563,7 +577,7 @@
> for( String g : e.getGoals() )
> {
> Xpp3Dom dom =
> getDefaultPluginConfiguration( p.getGroupId(), p.getArtifactId(),
> p.getVersion(), g, project, localRepository );
> - e.setConfiguration( dom );
> +
> e.setConfiguration( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom)
> e.getConfiguration(), dom, Boolean.TRUE ) );
> }
> }
> }
> @@ -594,11 +608,11 @@
>
> for( PlexusConfiguration ce : ces )
> {
> - if ( ce.getValue( null ) != null )
> + String defaultValue = ce.getAttribute( "default-value",
> null );
> + if ( ce.getValue( null ) != null || defaultValue !=
> null )
> {
> Xpp3Dom e = new Xpp3Dom( ce.getName() );
> e.setValue( ce.getValue( null ) );
> - String defaultValue = ce.getAttribute( "default-
> value", null );
> if ( defaultValue != null )
> {
> e.setAttribute( "default-value", defaultValue );
>
> Modified: maven/components/branches/MNG-2766/maven-core/src/main/
> java/org/apache/maven/project/DefaultMavenProjectBuilder.java
> URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=771154&r1=771153&r2=771154&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- maven/components/branches/MNG-2766/maven-core/src/main/java/org/
> apache/maven/project/DefaultMavenProjectBuilder.java (original)
> +++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/
> apache/maven/project/DefaultMavenProjectBuilder.java Mon May 4
> 01:08:40 2009
> @@ -191,7 +191,7 @@
> pln.add(copy);
> }
>
> - // Merge the various sources for mojo configuration:
> + // Merge the various sources for mojo configuration:
> // 1. default values from mojo descriptor
> // 2. POM values from per-plugin configuration
> // 3. POM values from per-execution configuration
> @@ -280,7 +280,7 @@
> return null;
> }
>
> - public static void addPluginsToModel(Model target, Set<Plugin>
> plugins)
> + public static void addPluginsToModel( Model target, Set<Plugin>
> plugins )
> {
> List<Plugin> mngPlugins =
> (target.getBuild().getPluginManagement() != null)
> ? target.getBuild().getPluginManagement().getPlugins() : new
> ArrayList<Plugin>();
> @@ -300,14 +300,19 @@
> }
>
> Plugin pomPlugin = containsPlugin( p, pomPlugins);
> - if( pomPlugin == null)
> - {
> - lifecyclePlugins.add(p);
> - }
> - else if(p.getConfiguration() != null)
> - {
> - System.out.println(Xpp3Dom.mergeXpp3Dom((Xpp3Dom)
> p.getConfiguration(), (Xpp3Dom) pomPlugin.getConfiguration()));
> - }
> + if ( pomPlugin == null )
> + {
> + lifecyclePlugins.add( p );
> + }
> + else
> + {
> + PluginProcessor.copy2( p, pomPlugin, true );
> + if ( p.getConfiguration() != null )
> + {
> +
> System.out.println( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom)
> p.getConfiguration(),
> +
> (Xpp3Dom) pomPlugin.getConfiguration() ) );
> + }
> + }
> }
> pomPlugins.addAll(lifecyclePlugins);
> target.getBuild().setPlugins(pomPlugins);
>
>
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/SonatypeNexus
http://twitter.com/SonatypeM2E
----------------------------------------------------------
A party which is not afraid of letting culture,
business, and welfare go to ruin completely can
be omnipotent for a while.
-- Jakob Burckhardt
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org