maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r391752 - in /maven/components/branches/maven-embedder-refactor: ./ maven-core-it/ maven-core-it/it0098/ maven-core-it/it0098/src/ maven-core-it/it0098/src/test/ maven-core-it/it0098/src/test/java/ maven-core-it/it0098/src/test/java/org/ ma...
Date Wed, 05 Apr 2006 19:43:59 GMT
Author: jvanzyl
Date: Wed Apr  5 12:43:51 2006
New Revision: 391752

URL: http://svn.apache.org/viewcvs?rev=391752&view=rev
Log:
merging in changes from trunk - now uptodate

Added:
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/
      - copied from r391750, maven/components/trunk/maven-core-it/it0098/src/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/test/
      - copied from r391750, maven/components/trunk/maven-core-it/it0098/src/test/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/test/java/
      - copied from r391750, maven/components/trunk/maven-core-it/it0098/src/test/java/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/test/java/org/
      - copied from r391750, maven/components/trunk/maven-core-it/it0098/src/test/java/org/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/test/java/org/apache/
      - copied from r391750, maven/components/trunk/maven-core-it/it0098/src/test/java/org/apache/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/test/java/org/apache/maven/
      - copied from r391750, maven/components/trunk/maven-core-it/it0098/src/test/java/org/apache/maven/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/test/java/org/apache/maven/it/
      - copied from r391750, maven/components/trunk/maven-core-it/it0098/src/test/java/org/apache/maven/it/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/test/java/org/apache/maven/it/it0098/
      - copied from r391750, maven/components/trunk/maven-core-it/it0098/src/test/java/org/apache/maven/it/it0098/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/src/test/java/org/apache/maven/it/it0098/QuotedCLIPropertyTest.java
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0098/src/test/java/org/apache/maven/it/it0098/QuotedCLIPropertyTest.java
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/
      - copied from r391750, maven/components/trunk/maven-core-it/it0103/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/goals.txt
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0103/goals.txt
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/level1/
      - copied from r391750, maven/components/trunk/maven-core-it/it0103/level1/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/level1/level2/
      - copied from r391750, maven/components/trunk/maven-core-it/it0103/level1/level2/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/level1/level2/level3/
      - copied from r391750, maven/components/trunk/maven-core-it/it0103/level1/level2/level3/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/level1/level2/level3/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0103/level1/level2/level3/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/level1/level2/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0103/level1/level2/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/level1/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0103/level1/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0103/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0103/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/goals.txt
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0104/goals.txt
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0104/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/main/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/main/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/main/java/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/main/java/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/main/java/org/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/main/java/org/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/main/java/org/apache/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/main/java/org/apache/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/main/java/org/apache/maven/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/main/java/org/apache/maven/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/main/java/org/apache/maven/it/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/main/java/org/apache/maven/it/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/main/java/org/apache/maven/it/App.java
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0104/src/main/java/org/apache/maven/it/App.java
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/test/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/test/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/test/java/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/test/java/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/test/java/org/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/test/java/org/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/test/java/org/apache/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/test/java/org/apache/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/test/java/org/apache/maven/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/test/java/org/apache/maven/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/test/java/org/apache/maven/it/
      - copied from r391750, maven/components/trunk/maven-core-it/it0104/src/test/java/org/apache/maven/it/
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0104/src/test/java/org/apache/maven/it/AppTest.java
      - copied unchanged from r391750, maven/components/trunk/maven-core-it/it0104/src/test/java/org/apache/maven/it/AppTest.java
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/inheritance/t02/
      - copied from r391750, maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t02/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t02/ProjectInheritanceTest.java
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/inheritance/t03/
      - copied from r391750, maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t03/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/inheritance/t03/ProjectInheritanceTest.java
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/inheritance/t03/ProjectInheritanceTest.java
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/p4/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/p4/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/p4/p5/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/p4/p5/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/p4/p5/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/p4/p5/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/p4/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/p4/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/p3/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/p2/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/p1/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t02/p0/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t02/p0/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t03/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t03/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t03/p0/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t03/p0/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t03/p0/p1/
      - copied from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t03/p0/p1/
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t03/p0/p1/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t03/p0/p1/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/resources/inheritance-repo/t03/p0/pom.xml
      - copied unchanged from r391750, maven/components/trunk/maven-project/src/test/resources/inheritance-repo/t03/p0/pom.xml
    maven/components/branches/maven-embedder-refactor/src/
      - copied from r391750, maven/components/trunk/src/
    maven/components/branches/maven-embedder-refactor/src/assemble/
      - copied from r391750, maven/components/trunk/src/assemble/
    maven/components/branches/maven-embedder-refactor/src/assemble/src.xml
      - copied unchanged from r391750, maven/components/trunk/src/assemble/src.xml
Removed:
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/expected-results.txt
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/verifier.properties
Modified:
    maven/components/branches/maven-embedder-refactor/maven-core-it/README.txt
    maven/components/branches/maven-embedder-refactor/maven-core-it/integration-tests.txt
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/cli-options.txt
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/goals.txt
    maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/pom.xml
    maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
    maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/MavenProjectTest.java
    maven/components/branches/maven-embedder-refactor/pom.xml

Modified: maven/components/branches/maven-embedder-refactor/maven-core-it/README.txt
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core-it/README.txt?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core-it/README.txt (original)
+++ maven/components/branches/maven-embedder-refactor/maven-core-it/README.txt Wed Apr  5
12:43:51 2006
@@ -277,6 +277,14 @@
 it0102: Test that <activeByDefault/> calculations for profile activation only
         use profiles defined in the POM. [MNG-2136]
 
+it0103: Verify that multimodule builds where one project references another as
+        a parent can build, even if that parent is not correctly referenced by
+        <relativePath/> and is not in the local repository. [MNG-2196]
+
+it0104: Verify that plugin configurations are resolved correctly, particularly
+        when they contain ${project.build.directory} in the string value of a 
+        Map.Entry.
+
 -------------------------------------------------------------------------------
 
 - generated sources

Modified: maven/components/branches/maven-embedder-refactor/maven-core-it/integration-tests.txt
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core-it/integration-tests.txt?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core-it/integration-tests.txt
(original)
+++ maven/components/branches/maven-embedder-refactor/maven-core-it/integration-tests.txt
Wed Apr  5 12:43:51 2006
@@ -1,3 +1,5 @@
+#it0104 Commenting out, not fixed until post-2.0.4, due to dependency on new plexus-container-default
version.
+it0103
 it0102
 it0101
 it0100

Modified: maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/cli-options.txt
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/cli-options.txt?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/cli-options.txt
(original)
+++ maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/cli-options.txt
Wed Apr  5 12:43:51 2006
@@ -1 +1 @@
--DgroupId=org.someproject "-DartifactId=test project"
+-Dtest.property="Test Property"

Modified: maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/goals.txt
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/goals.txt?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/goals.txt (original)
+++ maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/goals.txt Wed Apr
 5 12:43:51 2006
@@ -1 +1 @@
-archetype:create
+test

Modified: maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/pom.xml?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/pom.xml (original)
+++ maven/components/branches/maven-embedder-refactor/maven-core-it/it0098/pom.xml Wed Apr
 5 12:43:51 2006
@@ -1,6 +1,13 @@
 <project>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.maven.it0098</groupId>
-  <artifactId>it0098-archetype-orchestration-test</artifactId>
+  <artifactId>it0098</artifactId>
   <version>1</version>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+    </dependency>
+  </dependencies>
 </project>

Modified: maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Wed Apr  5 12:43:51 2006
@@ -151,8 +151,10 @@
     private ProfileInjector profileInjector;
 
     private ModelValidator validator;
+    
+    private Map rawProjectCache = new HashMap();
 
-    private Map projectCache = new HashMap();
+    private Map processedProjectCache = new HashMap();
 
     // TODO: make it a component
     private MavenXpp3Reader modelReader;
@@ -215,7 +217,7 @@
     {
         String cacheKey = createCacheKey( artifact.getGroupId(), artifact.getArtifactId(),
artifact.getVersion() );
 
-        MavenProject project = (MavenProject) projectCache.get( cacheKey );
+        MavenProject project = (MavenProject) processedProjectCache.get( cacheKey );
 
         if ( project != null )
         {
@@ -686,6 +688,8 @@
         }
 
         project.setOriginalModel( originalModel );
+        
+        rawProjectCache.put( createCacheKey( project.getGroupId(), project.getArtifactId(),
project.getVersion() ), new MavenProject( project ) );
 
         // we don't have to force the collision exception for superModel here, it's already
been done in getSuperModel()
         MavenProject previousProject = superProject;
@@ -743,7 +747,7 @@
             throw new InvalidProjectModelException( projectId, pomLocation, e.getMessage(),
e );
         }
 
-        projectCache.put( createCacheKey( project.getGroupId(), project.getArtifactId(),
project.getVersion() ), project );
+        processedProjectCache.put( createCacheKey( project.getGroupId(), project.getArtifactId(),
project.getVersion() ), project );
 
         // jvz:note
         // this only happens if we are building from a source file
@@ -763,10 +767,25 @@
             // Only track the file of a POM in the source tree
             project.setFile( projectDescriptor );
         }
+        
+        MavenProject rawParent = project.getParent();
+        
+        if ( rawParent != null )
+        {
+            String cacheKey = createCacheKey( rawParent.getGroupId(), rawParent.getArtifactId(),
rawParent.getVersion() );
+            
+            MavenProject processedParent = (MavenProject) processedProjectCache.get( cacheKey
);
+            
+            // yeah, this null check might be a bit paranoid, but better safe than sorry...
+            if ( processedParent != null )
+            {
+                project.setParent( processedParent );
+            }
+        }
 
         return project;
     }
-
+    
     private String safeVersionlessKey( String groupId, String artifactId )
     {
         String gid = groupId;
@@ -1006,7 +1025,17 @@
             File parentDescriptor = null;
 
             model = null;
-
+            
+            String parentKey = createCacheKey( parentModel.getGroupId(), parentModel.getArtifactId(),
parentModel.getVersion() );
+            MavenProject parentProject = (MavenProject) rawProjectCache.get( parentKey );
+    
+            if ( parentProject != null )
+            {
+                model = ModelUtils.cloneModel( parentProject.getModel() );
+                
+                parentDescriptor = parentProject.getFile();
+            }
+            
             String parentRelativePath = parentModel.getRelativePath();
 
             // if we can't find a cached model matching the parent spec, then let's try to
look on disk using

Modified: maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
(original)
+++ maven/components/branches/maven-embedder-refactor/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Wed Apr  5 12:43:51 2006
@@ -173,30 +173,71 @@
         {
             this.dependencyArtifacts = Collections.unmodifiableSet( project.dependencyArtifacts
);
         }
+        
         if ( project.artifacts != null )
         {
             this.artifacts = Collections.unmodifiableSet( project.artifacts );
         }
-        this.pluginArtifacts = Collections.unmodifiableSet( project.pluginArtifacts );
-        this.reportArtifacts = Collections.unmodifiableSet( project.reportArtifacts );
-        this.extensionArtifacts = Collections.unmodifiableSet( project.extensionArtifacts
);
+        
+        if ( project.pluginArtifacts != null )
+        {
+            this.pluginArtifacts = Collections.unmodifiableSet( project.pluginArtifacts );
+        }
+        
+        if ( project.reportArtifacts != null )
+        {
+            this.reportArtifacts = Collections.unmodifiableSet( project.reportArtifacts );
+        }        
+        
+        if ( project.extensionArtifacts != null )
+        {
+            this.extensionArtifacts = Collections.unmodifiableSet( project.extensionArtifacts
);
+        }        
+        
         this.parentArtifact = project.parentArtifact;
 
-        this.remoteArtifactRepositories = Collections.unmodifiableList( project.remoteArtifactRepositories
);
-        this.pluginArtifactRepositories = Collections.unmodifiableList( project.pluginArtifactRepositories
);
-        this.collectedProjects = Collections.unmodifiableList( project.collectedProjects
);
-        this.activeProfiles = Collections.unmodifiableList( project.activeProfiles );
-
-        // clone properties modifyable by plugins in a forked lifecycle
-        this.attachedArtifacts = new ArrayList( project.getAttachedArtifacts() );
-
-        // no need for execution project
-
-        // clone source roots
-        this.compileSourceRoots = new ArrayList( project.compileSourceRoots );
-        this.testCompileSourceRoots = new ArrayList( project.testCompileSourceRoots );
-        this.scriptSourceRoots = new ArrayList( project.scriptSourceRoots );
-
+        if ( project.remoteArtifactRepositories != null )
+        {
+            this.remoteArtifactRepositories = Collections.unmodifiableList( project.remoteArtifactRepositories
);
+        }        
+        
+        if ( project.pluginArtifactRepositories != null )
+        {
+            this.pluginArtifactRepositories = Collections.unmodifiableList( project.pluginArtifactRepositories
);
+        }        
+        
+        if ( project.collectedProjects != null )
+        {
+            this.collectedProjects = Collections.unmodifiableList( project.collectedProjects
);
+        }        
+        
+        if ( project.activeProfiles != null )
+        {
+            this.activeProfiles = Collections.unmodifiableList( project.activeProfiles );
+        }        
+        
+        if ( project.getAttachedArtifacts() != null )
+        {
+            // clone properties modifyable by plugins in a forked lifecycle
+            this.attachedArtifacts = new ArrayList( project.getAttachedArtifacts() );
+        }        
+        
+        if ( project.compileSourceRoots != null )
+        {
+            // clone source roots
+            this.compileSourceRoots = new ArrayList( project.compileSourceRoots );
+        }        
+        
+        if ( project.testCompileSourceRoots != null )
+        {
+            this.testCompileSourceRoots = new ArrayList( project.testCompileSourceRoots );
+        }        
+        
+        if ( project.scriptSourceRoots != null )
+        {
+            this.scriptSourceRoots = new ArrayList( project.scriptSourceRoots );
+        }        
+        
         this.model = ModelUtils.cloneModel( project.model );
 
         if ( project.originalModel != null )
@@ -206,7 +247,10 @@
 
         this.executionRoot = project.executionRoot;
 
-        this.artifact = ArtifactUtils.copyArtifact( project.artifact );
+        if ( project.artifact != null )
+        {
+            this.artifact = ArtifactUtils.copyArtifact( project.artifact );
+        }        
     }
     
     // TODO: Find a way to use <relativePath/> here...it's tricky, because the moduleProject
@@ -802,7 +846,14 @@
 
     public String getGroupId()
     {
-        return model.getGroupId();
+        String groupId = model.getGroupId();
+        
+        if ( groupId == null && model.getParent() != null )
+        {
+            groupId = model.getParent().getGroupId();
+        }
+        
+        return groupId;
     }
 
     public void setArtifactId( String artifactId )
@@ -840,7 +891,14 @@
 
     public String getVersion()
     {
-        return model.getVersion();
+        String version = model.getVersion();
+        
+        if ( version == null && model.getParent() != null )
+        {
+            version = model.getParent().getVersion();
+        }
+        
+        return version;
     }
 
     public String getPackaging()

Modified: maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/MavenProjectTest.java
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/MavenProjectTest.java?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/MavenProjectTest.java
(original)
+++ maven/components/branches/maven-embedder-refactor/maven-project/src/test/java/org/apache/maven/project/MavenProjectTest.java
Wed Apr  5 12:43:51 2006
@@ -20,10 +20,34 @@
 import java.io.IOException;
 
 import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
 
 public class MavenProjectTest
     extends AbstractMavenProjectTestCase
 {
+    
+    public void testIdentityProtoInheritance()
+    {
+        Parent parent = new Parent();
+        
+        parent.setGroupId( "test-group" );
+        parent.setVersion( "1000" );
+        parent.setArtifactId( "test-artifact" );
+        
+        Model model = new Model();
+        
+        model.setParent( parent );
+        model.setArtifactId( "real-artifact" );
+        
+        MavenProject project = new MavenProject( model );
+        
+        assertEquals( "groupId proto-inheritance failed.", "test-group", project.getGroupId()
);
+        assertEquals( "artifactId is masked.", "real-artifact", project.getArtifactId() );
+        assertEquals( "version proto-inheritance failed.", "1000", project.getVersion() );
+        
+        // draw the NPE.
+        project.getId();
+    }
     
     public void testEmptyConstructor()
     {

Modified: maven/components/branches/maven-embedder-refactor/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/branches/maven-embedder-refactor/pom.xml?rev=391752&r1=391751&r2=391752&view=diff
==============================================================================
--- maven/components/branches/maven-embedder-refactor/pom.xml (original)
+++ maven/components/branches/maven-embedder-refactor/pom.xml Wed Apr  5 12:43:51 2006
@@ -157,6 +157,9 @@
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-container-default</artifactId>
+        <!-- We need to upgrade this to 1.0-alpha-10-SNAPSHOT for >= 2.0.5, to correct
MNG-2201
+        <version>1.0-alpha-10-SNAPSHOT</version>
+        -->
         <version>1.0-alpha-9</version>
       </dependency>
       <dependency>



Mime
View raw message