maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-core/src/test/resources canonical-pom.xml
Date Fri, 01 Oct 2004 14:53:48 GMT
jvanzyl     2004/10/01 07:53:48

  Modified:    maven-core/src/main/java/org/apache/maven/project
                        MavenProject.java
               maven-core/src/main/java/org/apache/maven/project/inheritance
                        DefaultModelInheritanceAssembler.java
               maven-core/src/test/java/org/apache/maven/project/helpers
                        ProjectTestHelper.java
               maven-core/src/test/resources canonical-pom.xml
  Added:       maven-core/src/test/java/org/apache/maven/project/canonical
                        CanonicalProjectBuilderTest.java
  Log:
  o adding necessary bits and bobs for plugin configuration
  
  Revision  Changes    Path
  1.9       +10 -0     maven-components/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
  
  Index: MavenProject.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/MavenProject.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- MavenProject.java	22 Sep 2004 02:29:26 -0000	1.8
  +++ MavenProject.java	1 Oct 2004 14:53:47 -0000	1.9
  @@ -547,5 +547,15 @@
       {
           return model.getPostGoals();
       }
  +
  +    // ----------------------------------------------------------------------
  +    // Plugins
  +    // ----------------------------------------------------------------------
  +
  +    
  +    public List getPlugins()
  +    {
  +        return model.getPlugins();
  +    }
   }
   
  
  
  
  1.9       +16 -0     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultModelInheritanceAssembler.java	22 Sep 2004 02:58:12 -0000	1.8
  +++ DefaultModelInheritanceAssembler.java	1 Oct 2004 14:53:47 -0000	1.9
  @@ -21,6 +21,7 @@
   import org.apache.maven.model.PostGoal;
   import org.apache.maven.model.PreGoal;
   import org.apache.maven.model.Repository;
  +import org.apache.maven.model.Plugin;
   
   import java.util.Iterator;
   import java.util.List;
  @@ -264,6 +265,21 @@
               if ( !childRepositories.contains( repository ) )
               {
                   child.addRepository( repository );
  +            }
  +        }
  +
  +        // Plugins :: aggregate
  +        List parentPlugins = parent.getPlugins();
  +
  +        List childPlugins = child.getPlugins();
  +
  +        for ( Iterator iterator = parentPlugins.iterator(); iterator.hasNext(); )
  +        {
  +            Plugin plugin = (Plugin) iterator.next();
  +
  +            if ( !childPlugins.contains( plugin ) )
  +            {
  +                child.addPlugin( plugin );
               }
           }
       }
  
  
  
  1.1                  maven-components/maven-core/src/test/java/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.java
  
  Index: CanonicalProjectBuilderTest.java
  ===================================================================
  package org.apache.maven.project.canonical;
  
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  import junit.framework.TestCase;
  import org.apache.maven.model.Build;
  import org.apache.maven.model.Contributor;
  import org.apache.maven.model.Dependency;
  import org.apache.maven.model.Developer;
  import org.apache.maven.model.DistributionManagement;
  import org.apache.maven.model.MailingList;
  import org.apache.maven.model.Repository;
  import org.apache.maven.model.Resource;
  import org.apache.maven.model.Site;
  import org.apache.maven.model.UnitTest;
  import org.apache.maven.model.Plugin;
  import org.apache.maven.project.MavenProject;
  import org.apache.maven.MavenTestCase;
  
  import java.io.File;
  import java.util.List;
  import java.util.Properties;
  
  /**
   * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
   * @version $Id: CanonicalProjectBuilderTest.java,v 1.1 2004/10/01 14:53:48 jvanzyl Exp
$
   */
  public class CanonicalProjectBuilderTest
      extends MavenTestCase
  {
      public void testProjectBuilder()
          throws Exception
      {
          File f  = new File( basedir, "src/test/resources/canonical-pom.xml" );
  
          MavenProject project = projectBuilder.build( f );
  
          // ----------------------------------------------------------------------
          // Top-level elements
          // ----------------------------------------------------------------------
  
          assertEquals( "4.0.0", project.getModelVersion() );
  
          // ----------------------------------------------------------------------
          // Plugins
          // ----------------------------------------------------------------------
  
          List plugins = project.getPlugins();
  
          // Plugin0 [plexus]
  
          Plugin plugin = (Plugin) plugins.get( 0 );
  
          assertEquals( "plexus", plugin.getId() );
  
          assertEquals( "1.0", plugin.getVersion() );
  
          Properties properties = plugin.getConfiguration();
  
          assertEquals( "src/conf/plexus.conf", properties.getProperty( "plexusConfiguration"
) );
  
          assertEquals( "src/conf/plexus.properties", properties.getProperty( "plexusConfigurationPropertiesFile"
) );
  
          assertEquals( "Continuum", properties.getProperty( "plexusApplicationName" ) );
  
          // Plugin1 [antlr]
      }
  }
  
  
  
  1.3       +1 -3      maven-components/maven-core/src/test/java/org/apache/maven/project/helpers/ProjectTestHelper.java
  
  Index: ProjectTestHelper.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/java/org/apache/maven/project/helpers/ProjectTestHelper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProjectTestHelper.java	15 Sep 2004 12:34:17 -0000	1.2
  +++ ProjectTestHelper.java	1 Oct 2004 14:53:48 -0000	1.3
  @@ -61,8 +61,6 @@
   
           assertEquals( "http://maven.apache.org/", project.getUrl() );
   
  -
  -
           // ----------------------------------------------------------------------
           // Distribution
           // ----------------------------------------------------------------------
  
  
  
  1.2       +2 -1      maven-components/maven-core/src/test/resources/canonical-pom.xml
  
  Index: canonical-pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/resources/canonical-pom.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- canonical-pom.xml	1 Oct 2004 14:12:40 -0000	1.1
  +++ canonical-pom.xml	1 Oct 2004 14:53:48 -0000	1.2
  @@ -9,9 +9,10 @@
     <plugins>
       <plugin>
         <id>plexus</id>
  +      <version>1.0</version>
         <configuration>
           <plexusConfiguration>src/conf/plexus.conf</plexusConfiguration>
  -        <plexusConfigurationPropertiesFile>src/conf/plexus.conf</plexusConfigurationPropertiesFile>
       
  +        <plexusConfigurationPropertiesFile>src/conf/plexus.properties</plexusConfigurationPropertiesFile>
           <plexusApplicationName>Continuum</plexusApplicationName>
         </configuration>
       </plugin>
  
  
  

Mime
View raw message