maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/project/inheritance DefaultModelInheritanceAssembler.java
Date Fri, 15 Apr 2005 06:16:47 GMT
brett       2005/04/14 23:16:47

  Modified:    maven-core/src/main/java/org/apache/maven/lifecycle
                        DefaultLifecycleExecutor.java
               maven-core/src/main/java/org/apache/maven/project/inheritance
                        DefaultModelInheritanceAssembler.java
  Log:
  PR: MNG-285
  fix bug in plugin management inheritence
  
  Revision  Changes    Path
  1.34      +1 -32     maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
  
  Index: DefaultLifecycleExecutor.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- DefaultLifecycleExecutor.java	13 Apr 2005 11:34:09 -0000	1.33
  +++ DefaultLifecycleExecutor.java	15 Apr 2005 06:16:47 -0000	1.34
  @@ -16,32 +16,25 @@
    * limitations under the License.
    */
   
  -import org.apache.maven.MavenConstants;
   import org.apache.maven.artifact.handler.ArtifactHandler;
   import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
   import org.apache.maven.artifact.resolver.ArtifactResolver;
   import org.apache.maven.execution.MavenExecutionResponse;
   import org.apache.maven.execution.MavenSession;
   import org.apache.maven.model.Goal;
  -import org.apache.maven.model.Model;
   import org.apache.maven.model.Plugin;
   import org.apache.maven.model.PluginManagement;
  -import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
   import org.apache.maven.monitor.event.EventDispatcher;
   import org.apache.maven.monitor.event.MavenEvents;
   import org.apache.maven.plugin.PluginExecutionException;
   import org.apache.maven.plugin.PluginManager;
   import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.apache.maven.plugin.descriptor.PluginDescriptor;
  -import org.apache.maven.project.DefaultMavenProjectBuilder;
   import org.apache.maven.project.MavenProject;
   import org.apache.maven.project.MavenProjectBuilder;
   import org.codehaus.plexus.logging.AbstractLogEnabled;
   import org.codehaus.plexus.logging.Logger;
  -import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
   
  -import java.io.InputStreamReader;
  -import java.net.URL;
   import java.util.Date;
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -55,7 +48,7 @@
    */
   public class DefaultLifecycleExecutor
       extends AbstractLogEnabled
  -    implements LifecycleExecutor, Initializable
  +    implements LifecycleExecutor
   {
       // ----------------------------------------------------------------------
       // Components
  @@ -71,9 +64,6 @@
   
       private List phases;
   
  -    // TODO: remove
  -    private Model superModel;
  -
       // ----------------------------------------------------------------------
       //
       // ----------------------------------------------------------------------
  @@ -194,20 +184,6 @@
   
               if ( plugin.getVersion() == null )
               {
  -                PluginManagement pluginManagement = superModel.getBuild().getPluginManagement();
  -
  -                if ( pluginManagement != null )
  -                {
  -                    Plugin management = findPlugin( pluginManagement.getPlugins(), groupId,
artifactId );
  -                    if ( management != null && management.getVersion() != null
)
  -                    {
  -                        plugin.setVersion( management.getVersion() );
  -                    }
  -                }
  -            }
  -
  -            if ( plugin.getVersion() == null )
  -            {
                   // TODO: this has probably supplanted the default in the plugin manager
                   plugin.setVersion( "1.0-SNAPSHOT" );
               }
  @@ -454,11 +430,4 @@
           return phases;
       }
   
  -    public void initialize()
  -        throws Exception
  -    {
  -        // TODO: get rid of this and the interface...
  -        URL url = DefaultMavenProjectBuilder.class.getResource( "pom-" + MavenConstants.MAVEN_MODEL_VERSION
+ ".xml" );
  -        superModel = new MavenXpp3Reader().read( new InputStreamReader( url.openStream()
) );
  -    }
   }
  \ No newline at end of file
  
  
  
  1.30      +6 -1      maven-components/maven-core/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java
  
  Index: DefaultModelInheritanceAssembler.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- DefaultModelInheritanceAssembler.java	13 Apr 2005 11:34:09 -0000	1.29
  +++ DefaultModelInheritanceAssembler.java	15 Apr 2005 06:16:47 -0000	1.30
  @@ -201,7 +201,7 @@
       private void assemblePluginManagementInheritance( Model child, Model parent )
       {
           Build parentBuild = parent.getBuild();
  -        Build childBuild = parent.getBuild();
  +        Build childBuild = child.getBuild();
   
           if ( childBuild == null )
           {
  @@ -248,6 +248,11 @@
                           {
                               Plugin childPlugin = (Plugin) mappedChildPlugins.get( constructPluginKey(
plugin ) );
   
  +                            if ( childPlugin.getVersion() == null )
  +                            {
  +                                childPlugin.setVersion( childPlugin.getVersion() );
  +                            }
  +
                               Map mappedChildGoals = new TreeMap();
                               for ( Iterator itGoals = childPlugin.getGoals().iterator();
itGoals.hasNext(); )
                               {
  
  
  

Mime
View raw message