You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2019/07/06 16:29:34 UTC

[maven] branch MNG-6700 updated (c68ec10 -> 84bf187)

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

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


 discard c68ec10  [MNG-6700] Same compile source roots are added multiple times
     add 8da81ce  [MNG-6701] Document maven.repo.local property
     new 84bf187  [MNG-6700] Equal compile source roots are added multiple times

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   (c68ec10)
            \
             N -- N -- N   refs/heads/MNG-6700 (84bf187)

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:
 maven-model-builder/src/site/apt/index.apt | 2 ++
 1 file changed, 2 insertions(+)


[maven] 01/01: [MNG-6700] Equal compile source roots are added multiple times

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

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

commit 84bf1877f0b54144edcb85094fe10302e236303e
Author: Bo Zhang <bo...@gradle.com>
AuthorDate: Sat Jul 6 08:26:26 2019 +0800

    [MNG-6700] Equal compile source roots are added multiple times
    
    This closes #266
---
 .../main/java/org/apache/maven/project/MavenProject.java    |  4 ++++
 .../java/org/apache/maven/project/MavenProjectTest.java     | 13 +++++++++++++
 2 files changed, 17 insertions(+)

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 fd02557..bf10961 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
@@ -304,6 +304,10 @@ public class MavenProject
                 {
                     path = file.getAbsolutePath();
                 }
+                else if ( ".".equals( path ) )
+                {
+                    path = getBasedir().getAbsolutePath();
+                }
                 else
                 {
                     path = new File( getBasedir(), path ).getAbsolutePath();
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 02d64b2..6b4258b 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
@@ -198,6 +198,19 @@ public class MavenProjectTest
         assertNoNulls( p.getTestClasspathElements() );
     }
 
+    public void testAddDotFile()
+    {
+        MavenProject project = new MavenProject();
+
+        File basedir = new File( System.getProperty( "java.io.tmpdir" ) );
+        project.setFile( new File( basedir, "file" ) );
+
+        project.addCompileSourceRoot( basedir.getAbsolutePath() );
+        project.addCompileSourceRoot( "." );
+
+        assertEquals( 1, project.getCompileSourceRoots().size() );
+    }
+
     private void assertNoNulls( List<String> elements )
     {
         assertFalse( elements.contains( null ) );