You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2019/04/15 21:34:46 UTC

[maven] branch MNG-6405 updated (6178443 -> fd7c6a1)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch MNG-6405
in repository https://gitbox.apache.org/repos/asf/maven.git.


 discard 6178443  [MNG-6405] Fix basedir in MavenProject.deepCopy.
     add 715d90b  Update DOAP Information for new release.
     new fd7c6a1  [MNG-6405] Fix basedir in MavenProject.deepCopy.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6178443)
            \
             N -- N -- N   refs/heads/MNG-6405 (fd7c6a1)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doap_Maven.rdf                                                | 11 +++++++++++
 .../test/java/org/apache/maven/project/MavenProjectTest.java  | 11 +++++++++++
 2 files changed, 22 insertions(+)


[maven] 01/01: [MNG-6405] Fix basedir in MavenProject.deepCopy.

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MNG-6405
in repository https://gitbox.apache.org/repos/asf/maven.git

commit fd7c6a13ca6670869600a30912a5d2acfde72896
Author: Jesse Glick <jg...@apache.org>
AuthorDate: Thu Jan 3 17:20:05 2019 -0500

    [MNG-6405] Fix basedir in MavenProject.deepCopy.
---
 .../src/main/java/org/apache/maven/project/MavenProject.java  |  3 ++-
 .../test/java/org/apache/maven/project/MavenProjectTest.java  | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
index fd7ab40..fd02557 100644
--- a/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
+++ b/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
@@ -1207,7 +1207,8 @@ public class MavenProject
         // disown the parent
 
         // copy fields
-        setFile( project.getFile() );
+        file = project.file;
+        basedir = project.basedir;
 
         // don't need a deep copy, they don't get modified or added/removed to/from - but make them unmodifiable to be
         // sure!
diff --git a/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java b/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
index 1bc75ab..02d64b2 100644
--- a/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/MavenProjectTest.java
@@ -177,6 +177,17 @@ public class MavenProjectTest
                        activeProfilesClone );
     }
 
+    public void testCloneWithBaseDir()
+        throws Exception
+    {
+        File f = getFileForClasspathResource( "canonical-pom.xml" );
+        MavenProject projectToClone = getProject( f );
+        projectToClone.setPomFile( new File( new File( f.getParentFile(), "target" ), "flattened.xml" ) );
+        MavenProject clonedProject = projectToClone.clone();
+        assertEquals( "POM file is preserved across clone", projectToClone.getFile(), clonedProject.getFile() );
+        assertEquals( "Base directory is preserved across clone", projectToClone.getBasedir(), clonedProject.getBasedir() );
+    }
+
     public void testUndefinedOutputDirectory()
         throws Exception
     {