You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/03/28 10:29:25 UTC

[maven] branch MNG-4660 created (now 28a6e2c)

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

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


      at 28a6e2c  Replace checking if the project has the lifecyclePhase "validate" by checking if the project consists in the reactor.

This branch includes the following new commits:

     new caababc  Include already built submodules in Reactor for local dependency resolving.
     new 6d5b0cb  Do not check whether calculated directory actually exists
     new e813cde  Inspect all projects in Reactor when retrieving metadata
     new 1f20eb3  Update comment
     new 1c1ede0  Make ReactorReader aware of possible previous built artifacts
     new 39b7e02  Only use module output directory when it has been compiled in this session
     new fa9f509  Update contributors list
     new af97c91  Prefer the target/classes directory when the packaged artifact is not up-to-date.
     new 1897148  Use Files.walk instead of .list to recursively check for newer class files when checking if the packaged artifact is up-to-date
     new 7d25e4a  Also include build output directory when the project does not have a compile lifecycle when reading local artifacts. This is needed for resolving intermodule dependencies which are not built in this session (for example with -rf, -pl flags).
     new 1ee24c2  Checkstyle fixes
     new 83dd0ee  More sophisticated rules for determining project artifact
     new 543cb31  Remove obsolete comment
     new 28a6e2c  Replace checking if the project has the lifecyclePhase "validate" by checking if the project consists in the reactor.

The 14 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.



[maven] 11/14: Checkstyle fixes

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

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

commit 1ee24c2a7e7a6dfa190c93cfa5f5bbd09b2615e4
Author: Martin Kanters <Ma...@infosupport.com>
AuthorDate: Thu Mar 26 11:18:19 2020 +0100

    Checkstyle fixes
---
 .../java/org/apache/maven/project/artifact/MavenMetadataSource.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
index cacbd9d..1c718e3 100644
--- a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
+++ b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
@@ -195,10 +195,10 @@ public class MavenMetadataSource
             managedDependencies = dependencyManagement == null ? null : dependencyManagement.getDependencies();
             MavenSession session = legacySupport.getSession();
             pomRepositories = session.getProjects().stream()
-                    .filter(p -> artifact.equals( p.getArtifact() ) )
-                    .map(MavenProject::getRemoteArtifactRepositories)
+                    .filter( p -> artifact.equals( p.getArtifact() ) )
+                    .map( MavenProject::getRemoteArtifactRepositories )
                     .findFirst()
-                    .orElseGet(ArrayList::new);
+                    .orElseGet( ArrayList::new );
         }
         else if ( artifact instanceof ArtifactWithDependencies )
         {


[maven] 05/14: Make ReactorReader aware of possible previous built artifacts

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

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

commit 1c1ede0281eb67378ca46bbbfb3fe7f18dca1307
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 12:51:16 2020 +0100

    Make ReactorReader aware of possible previous built artifacts
---
 .../main/java/org/apache/maven/ReactorReader.java   | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index f840cb5..7c52ff2 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -157,12 +157,18 @@ class ReactorReader
         }
 
         Artifact projectArtifact = findMatchingArtifact( project, artifact );
+        File packagedArtifactFile = determinePreviouslyPackagedArtifactFile( project, projectArtifact );
 
         if ( hasArtifactFileFromPackagePhase( projectArtifact ) )
         {
             return projectArtifact.getFile();
         }
-        else if ( !hasBeenPackaged( project ) )
+        // Check whether an earlier Maven run might have produced an artifact that is still on disk.
+        else if ( packagedArtifactFile != null && packagedArtifactFile.exists() )
+        {
+            return packagedArtifactFile;
+        }
+        else if ( !hasBeenPackagedDuringThisSession( project ) )
         {
             // fallback to loose class files only if artifacts haven't been packaged yet
             // and only for plain old jars. Not war files, not ear files, not anything else.
@@ -189,12 +195,23 @@ class ReactorReader
         return null;
     }
 
+    private File determinePreviouslyPackagedArtifactFile( MavenProject project, Artifact artifact )
+    {
+        if ( artifact == null )
+        {
+            return null;
+        }
+
+        String fileName = String.format( "%s.%s", project.getBuild().getFinalName(), artifact.getExtension() );
+        return new File( project.getBuild().getDirectory(), fileName );
+    }
+
     private boolean hasArtifactFileFromPackagePhase( Artifact projectArtifact )
     {
         return projectArtifact != null && projectArtifact.getFile() != null && projectArtifact.getFile().exists();
     }
 
-    private boolean hasBeenPackaged( MavenProject project )
+    private boolean hasBeenPackagedDuringThisSession( MavenProject project )
     {
         return project.hasLifecyclePhase( "package" ) || project.hasLifecyclePhase( "install" )
             || project.hasLifecyclePhase( "deploy" );


[maven] 08/14: Prefer the target/classes directory when the packaged artifact is not up-to-date.

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

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

commit af97c91d36ca92794374aaa4d9ee28b9378cb042
Author: Martin Kanters <Ma...@ing.com>
AuthorDate: Mon Mar 9 12:29:26 2020 +0100

    Prefer the target/classes directory when the packaged artifact is not up-to-date.
---
 .../main/java/org/apache/maven/ReactorReader.java  | 45 +++++++++++++++++++++-
 1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index 2bfb9ee..3f320a1 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -20,6 +20,10 @@ package org.apache.maven;
  */
 
 import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -28,6 +32,8 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
 
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -37,6 +43,7 @@ import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Model;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.repository.internal.MavenWorkspaceReader;
+import org.codehaus.plexus.logging.Logger;
 import org.eclipse.aether.artifact.Artifact;
 import org.eclipse.aether.repository.WorkspaceRepository;
 import org.eclipse.aether.util.artifact.ArtifactIdUtils;
@@ -57,6 +64,8 @@ class ReactorReader
     private static final Collection<String> COMPILE_PHASE_TYPES =
         Arrays.asList( "jar", "ejb-client", "war", "rar", "ejb3", "par", "sar", "wsr", "har", "app-client" );
 
+    private Logger logger;
+
     private Map<String, MavenProject> projectsByGAV;
 
     private Map<String, List<MavenProject>> projectsByGA;
@@ -64,8 +73,9 @@ class ReactorReader
     private WorkspaceRepository repository;
 
     @Inject
-    ReactorReader( MavenSession session )
+    ReactorReader( MavenSession session, Logger logger )
     {
+        this.logger = logger;
         this.projectsByGAV = new HashMap<>( session.getAllProjects().size() * 2 );
         session.getAllProjects().forEach( project ->
         {
@@ -164,7 +174,8 @@ class ReactorReader
             return projectArtifact.getFile();
         }
         // Check whether an earlier Maven run might have produced an artifact that is still on disk.
-        else if ( packagedArtifactFile != null && packagedArtifactFile.exists() )
+        else if ( packagedArtifactFile != null && packagedArtifactFile.exists()
+                && isPackagedArtifactUpToDate( project, packagedArtifactFile ) )
         {
             return packagedArtifactFile;
         }
@@ -211,6 +222,36 @@ class ReactorReader
         return projectArtifact != null && projectArtifact.getFile() != null && projectArtifact.getFile().exists();
     }
 
+    private boolean isPackagedArtifactUpToDate( MavenProject project, File packagedArtifactFile )
+    {
+        Path outputDirectory = Paths.get( project.getBuild().getOutputDirectory() );
+        if ( !outputDirectory.toFile().exists() )
+        {
+            return true;
+        }
+
+        try ( Stream<Path> outputFiles = Files.list( outputDirectory ) )
+        {
+            long artifactLastModified = packagedArtifactFile.lastModified();
+            Predicate<Path> isNewerThanPackagedArtifact = path -> path.toFile().lastModified() > artifactLastModified;
+            boolean isPackagedArtifactUpToDate = outputFiles.noneMatch( isNewerThanPackagedArtifact );
+
+            if ( !isPackagedArtifactUpToDate )
+            {
+                logger.warn( "Packaged artifact is not up-to-date compared to the build output directory" );
+            }
+
+            return isPackagedArtifactUpToDate;
+        }
+        catch ( IOException e )
+        {
+            logger.warn( "An I/O error occurred while checking if the packaged artifact is up-to-date "
+                    + "against the build output directory. "
+                    + "Continuing with the assumption that it is up-to-date.", e );
+            return true;
+        }
+    }
+
     private boolean hasBeenPackagedDuringThisSession( MavenProject project )
     {
         return project.hasLifecyclePhase( "package" ) || project.hasLifecyclePhase( "install" )


[maven] 14/14: Replace checking if the project has the lifecyclePhase "validate" by checking if the project consists in the reactor.

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

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

commit 28a6e2cd4a3b12989490a03f725372417cf477ba
Author: Martin Kanters <Ma...@infosupport.com>
AuthorDate: Thu Mar 26 18:09:28 2020 +0100

    Replace checking if the project has the lifecyclePhase "validate" by checking if the project consists in the reactor.
---
 maven-core/src/main/java/org/apache/maven/ReactorReader.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index 0d28a3a..ddc74f7 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -66,6 +66,8 @@ class ReactorReader
 
     private Logger logger;
 
+    private MavenSession session;
+
     private Map<String, MavenProject> projectsByGAV;
 
     private Map<String, List<MavenProject>> projectsByGA;
@@ -76,6 +78,7 @@ class ReactorReader
     ReactorReader( MavenSession session, Logger logger )
     {
         this.logger = logger;
+        this.session = session;
         this.projectsByGAV = new HashMap<>( session.getAllProjects().size() * 2 );
         session.getAllProjects().forEach( project ->
         {
@@ -196,15 +199,15 @@ class ReactorReader
                 String type = artifact.getProperty( "type", "" );
                 File outputDirectory = new File( project.getBuild().getOutputDirectory() );
 
-                // Check if the target project is being built during this session, and if we can expect any output.
+                // Check if the project is being built during this session, and if we can expect any output.
                 // There is no need to check if the build has created any outputs, see MNG-2222.
                 boolean projectCompiledDuringThisSession
                         = project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type );
 
-                // Check if the target project lacks 'validate' so we know it's not part of the build at all. If so, we
-                // check if a possible earlier Maven invocation produced some output for that project.
+                // Check if the project is part of the session (not filtered by -pl, -rf, etc). If so, we check
+                // if a possible earlier Maven invocation produced some output for that project which we can use.
                 boolean projectHasOutputFromPreviousSession
-                        = !project.hasLifecyclePhase( "validate" ) && outputDirectory.exists();
+                        = !session.getProjects().contains( project ) && outputDirectory.exists();
 
                 if ( projectHasOutputFromPreviousSession || projectCompiledDuringThisSession )
                 {


[maven] 09/14: Use Files.walk instead of .list to recursively check for newer class files when checking if the packaged artifact is up-to-date

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

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

commit 1897148a86ef27361899946fbc217fb8b2f8b82e
Author: Martin Kanters <Ma...@infosupport.com>
AuthorDate: Mon Mar 9 14:22:25 2020 +0100

    Use Files.walk instead of .list to recursively check for newer class files when checking if the packaged artifact is up-to-date
---
 maven-core/src/main/java/org/apache/maven/ReactorReader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index 3f320a1..e029660 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -230,7 +230,7 @@ class ReactorReader
             return true;
         }
 
-        try ( Stream<Path> outputFiles = Files.list( outputDirectory ) )
+        try ( Stream<Path> outputFiles = Files.walk( outputDirectory ) )
         {
             long artifactLastModified = packagedArtifactFile.lastModified();
             Predicate<Path> isNewerThanPackagedArtifact = path -> path.toFile().lastModified() > artifactLastModified;


[maven] 04/14: Update comment

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

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

commit 1f20eb37642c1b0b7b0ab19095e43d0a2fdc48a1
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 12:50:18 2020 +0100

    Update comment
---
 maven-core/src/main/java/org/apache/maven/execution/MavenSession.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
index 5b56df3..8da252f 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java
@@ -297,7 +297,7 @@ public class MavenSession
     private final Settings settings;
     
     @Deprecated
-    /** @deprecated This appears to only be used in the ReactorReader and we can do any processing required there */
+    /** @deprecated This appears not to be used anywhere within Maven itself. */
     public Map<String, MavenProject> getProjectMap() 
     {
         return projectMap;


[maven] 12/14: More sophisticated rules for determining project artifact

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

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

commit 83dd0ee3cc9ee09dc801215bccc1943911e222ff
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Thu Mar 26 13:59:38 2020 +0100

    More sophisticated rules for determining project artifact
    
    It now properly distinguishes between two situations:
    1. project artifact has been built during earlier Maven session
    2. project artifact has been built during this session
---
 .../src/main/java/org/apache/maven/ReactorReader.java   | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index 7c85668..71e70b9 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -194,9 +194,22 @@ class ReactorReader
             else
             {
                 String type = artifact.getProperty( "type", "" );
-                if ( COMPILE_PHASE_TYPES.contains( type ) )
+                File outputDirectory = new File( project.getBuild().getOutputDirectory() );
+
+                // Check if the target project is being built during this session, and if we can expect any output.
+                // There is no need to check if the build has created any outputs, see MNG-2222.
+                boolean projectCompiledDuringThisSession
+                        = project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type );
+
+                // Check if the target project lacks 'validate' so we know it's not part of the build at all. If so, we
+                // check if a possible earlier Maven invocation produced some output for that project.
+                boolean projectHasOutputFromPreviousSession
+                        = !project.hasLifecyclePhase( "validate" ) && outputDirectory.exists();
+
+                if ( projectHasOutputFromPreviousSession || projectCompiledDuringThisSession )
                 {
-                    return new File( project.getBuild().getOutputDirectory() );
+                    // If the target project is not part of the build,
+                    return outputDirectory;
                 }
             }
         }


[maven] 01/14: Include already built submodules in Reactor for local dependency resolving.

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

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

commit caababc0eadc7585f38ca975b2be244af73e04be
Author: Martin Kanters <Ma...@ing.com>
AuthorDate: Wed Jan 29 16:21:39 2020 +0100

    Include already built submodules in Reactor for local dependency resolving.
---
 .../src/main/java/org/apache/maven/ReactorReader.java     | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index 831a4b6..b9434ee 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -66,7 +66,12 @@ class ReactorReader
     @Inject
     ReactorReader( MavenSession session )
     {
-        projectsByGAV = session.getProjectMap();
+        this.projectsByGAV = new HashMap<>( session.getAllProjects().size() * 2 );
+        session.getAllProjects().forEach( project ->
+        {
+            String projectId = ArtifactUtils.key( project.getGroupId(), project.getArtifactId(), project.getVersion() );
+            this.projectsByGAV.put( projectId, project );
+        } );
 
         projectsByGA = new HashMap<>( projectsByGAV.size() * 2 );
         for ( MavenProject project : projectsByGAV.values() )
@@ -172,9 +177,13 @@ class ReactorReader
             else
             {
                 String type = artifact.getProperty( "type", "" );
-                if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) )
+                if ( COMPILE_PHASE_TYPES.contains( type ) )
                 {
-                    return new File( project.getBuild().getOutputDirectory() );
+                    File outputDirectory = new File( project.getBuild().getOutputDirectory() );
+                    if ( outputDirectory.exists() )
+                    {
+                        return outputDirectory;
+                    }
                 }
             }
         }


[maven] 10/14: Also include build output directory when the project does not have a compile lifecycle when reading local artifacts. This is needed for resolving intermodule dependencies which are not built in this session (for example with -rf, -pl flags).

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

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

commit 7d25e4af7d601b9dbf65a213f01f53e71bc4d1ad
Author: Martin Kanters <Ma...@infosupport.com>
AuthorDate: Thu Mar 26 11:17:16 2020 +0100

    Also include build output directory when the project does not have a compile lifecycle when reading local artifacts. This is needed for resolving intermodule dependencies which are not built in this session (for example with -rf, -pl flags).
---
 maven-core/src/main/java/org/apache/maven/ReactorReader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index e029660..7c85668 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -194,7 +194,7 @@ class ReactorReader
             else
             {
                 String type = artifact.getProperty( "type", "" );
-                if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) )
+                if ( COMPILE_PHASE_TYPES.contains( type ) )
                 {
                     return new File( project.getBuild().getOutputDirectory() );
                 }


[maven] 03/14: Inspect all projects in Reactor when retrieving metadata

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

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

commit e813cde743db1638041604e3a6fdc5f4735f17d4
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 12:49:53 2020 +0100

    Inspect all projects in Reactor when retrieving metadata
---
 .../org/apache/maven/project/artifact/MavenMetadataSource.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
index 1c40af8..cacbd9d 100644
--- a/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
+++ b/maven-core/src/main/java/org/apache/maven/project/artifact/MavenMetadataSource.java
@@ -194,9 +194,11 @@ public class MavenMetadataSource
             DependencyManagement dependencyManagement = model.getDependencyManagement();
             managedDependencies = dependencyManagement == null ? null : dependencyManagement.getDependencies();
             MavenSession session = legacySupport.getSession();
-            MavenProject project = session.getProjectMap().get(
-                ArtifactUtils.key( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ) );
-            pomRepositories = project.getRemoteArtifactRepositories();
+            pomRepositories = session.getProjects().stream()
+                    .filter(p -> artifact.equals( p.getArtifact() ) )
+                    .map(MavenProject::getRemoteArtifactRepositories)
+                    .findFirst()
+                    .orElseGet(ArrayList::new);
         }
         else if ( artifact instanceof ArtifactWithDependencies )
         {


[maven] 07/14: Update contributors list

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

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

commit fa9f5093d8762fc4bd3c8b954a493136201f1853
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 13:40:28 2020 +0100

    Update contributors list
---
 pom.xml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index ef2764d..7976341 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,7 +158,12 @@ under the License.
       <name>Mike Mol (MNG-6665)</name>
     </contributor>
     <contributor>
-      <name>Martin Kanters (MNG-6665, MNG-6065)</name>
+      <name>Martin Kanters</name>
+      <organization>Info Support</organization>
+    </contributor>
+    <contributor>
+      <name>Maarten Mulders</name>
+      <organization>Info Support</organization>
     </contributor>
     <contributor>
       <name>Luc Klaassen (MNG-6065)</name>


[maven] 06/14: Only use module output directory when it has been compiled in this session

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

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

commit 39b7e0240c71d1f6ca8b420e15598b7e870f3591
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 15:18:30 2020 +0100

    Only use module output directory when it has been compiled in this session
---
 maven-core/src/main/java/org/apache/maven/ReactorReader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index 7c52ff2..2bfb9ee 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -183,7 +183,7 @@ class ReactorReader
             else
             {
                 String type = artifact.getProperty( "type", "" );
-                if ( COMPILE_PHASE_TYPES.contains( type ) )
+                if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) )
                 {
                     return new File( project.getBuild().getOutputDirectory() );
                 }


[maven] 13/14: Remove obsolete comment

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

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

commit 543cb316fa99c1e21f4333eaa33bcbdfed1db8bb
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Thu Mar 26 14:10:47 2020 +0100

    Remove obsolete comment
---
 maven-core/src/main/java/org/apache/maven/ReactorReader.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index 71e70b9..0d28a3a 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -208,7 +208,6 @@ class ReactorReader
 
                 if ( projectHasOutputFromPreviousSession || projectCompiledDuringThisSession )
                 {
-                    // If the target project is not part of the build,
                     return outputDirectory;
                 }
             }


[maven] 02/14: Do not check whether calculated directory actually exists

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

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

commit 6d5b0cbfe08f7ea3fe144caa0834574ed58e6ce3
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Wed Jan 29 21:35:10 2020 +0100

    Do not check whether calculated directory actually exists
---
 maven-core/src/main/java/org/apache/maven/ReactorReader.java | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
index b9434ee..f840cb5 100644
--- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java
+++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java
@@ -179,11 +179,7 @@ class ReactorReader
                 String type = artifact.getProperty( "type", "" );
                 if ( COMPILE_PHASE_TYPES.contains( type ) )
                 {
-                    File outputDirectory = new File( project.getBuild().getOutputDirectory() );
-                    if ( outputDirectory.exists() )
-                    {
-                        return outputDirectory;
-                    }
+                    return new File( project.getBuild().getOutputDirectory() );
                 }
             }
         }