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/30 15:37:52 UTC
[maven] 01/18: 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 5834c5ab934198e93237888e1f42306bdb3dae46
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;
+ }
}
}
}