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:26 UTC

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

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;
+                    }
                 }
             }
         }