From 72e2478ec589e906afa1409c192cee7e33adde96 Mon Sep 17 00:00:00 2001 From: Karl Heinz Marbaise Date: Fri, 16 Oct 2015 15:33:13 +0200 Subject: [PATCH] [MNG-5898] Multi-module build with ear fails to resolve war in 3.3.3 --- .../src/main/java/org/apache/maven/ReactorReader.java | 9 +++++---- 1 file changed, 5 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 7fd89e4a93..11e78a5c47 100644 --- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java +++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -165,7 +165,6 @@ class ReactorReader else if ( !hasBeenPackaged( 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. if ( isTestArtifact( artifact ) ) { @@ -176,8 +175,7 @@ class ReactorReader } else { - String type = artifact.getProperty( "type", "" ); - if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) ) + if ( project.hasLifecyclePhase( "compile" ) ) { return new File( project.getBuild().getOutputDirectory() ); } @@ -221,7 +219,10 @@ class ReactorReader { if ( attachedArtifactComparison( requestedArtifact, attachedArtifact ) ) { - return attachedArtifact; + if ( requestedRepositoryConflictId.equals( ArtifactIdUtils.toVersionlessId( attachedArtifact ) ) ) + { + return attachedArtifact; + } } }