maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r681796 - /maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Date Fri, 01 Aug 2008 19:35:22 GMT
Author: jdcasey
Date: Fri Aug  1 12:35:21 2008
New Revision: 681796

URL: http://svn.apache.org/viewvc?rev=681796&view=rev
Log:
[MNG-3693] Decouple project basedir from changes in the project POM file, to keep it from
changing in response to modifications from plugins, like the shade plugin's dependency-reduced
POM.

Modified:
    maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java

Modified: maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java?rev=681796&r1=681795&r2=681796&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
(original)
+++ maven/components/branches/maven-2.0.10-RC/maven-project/src/main/java/org/apache/maven/project/MavenProject.java
Fri Aug  1 12:35:21 2008
@@ -151,6 +151,8 @@
     
     private Map moduleAdjustments;
 
+    private File basedir;
+
     public MavenProject()
     {
         Model model = new Model();
@@ -423,20 +425,27 @@
 
     public void setFile( File file )
     {
+        if ( file == null )
+        {
+            return;
+        }
+        
+        if ( basedir == null )
+        {
+            basedir = file.getParentFile();
+        }
+        
         this.file = file;
     }
+    
+    public void setBasedir( File basedir )
+    {
+        this.basedir = basedir;
+    }
 
     public File getBasedir()
     {
-        if ( getFile() != null )
-        {
-            return getFile().getParentFile();
-        }
-        else
-        {
-            // repository based POM
-            return null;
-        }
+        return basedir;
     }
 
     public void setDependencies( List dependencies )



Mime
View raw message