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 747e1fbb96..9afe864765 100644 --- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java +++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -27,6 +27,7 @@ import org.sonatype.aether.repository.WorkspaceRepository; import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -42,13 +43,16 @@ import java.util.Map; class ReactorReader implements WorkspaceReader { + private final static Collection JAR_LIKE_TYPES = Arrays.asList( "jar", "test-jar", "ejb-client" ); + + private final static Collection COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" ); private Map projectsByGAV; private Map> projectsByGA; private WorkspaceRepository repository; - + public ReactorReader( Map reactorProjects ) { projectsByGAV = reactorProjects; @@ -99,7 +103,8 @@ class ReactorReader } else { - if ( project.hasLifecyclePhase( "compile" ) && artifact.getProperty( "type", "").equals( "jar" ) ) /* also reject non-"" classifier? */ + String type = artifact.getProperty( "type", ""); + if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) ) { return new File( project.getBuild().getOutputDirectory() ); } @@ -194,11 +199,7 @@ class ReactorReader { typeOk = true; } - else if ( "test-jar".equals ( requestedType ) && "jar".equals( attachedType ) ) - { - typeOk = true; - } - else if ( "jar".equals ( requestedType ) && "test-jar".equals( attachedType ) ) + else if ( JAR_LIKE_TYPES.contains( requestedType ) && JAR_LIKE_TYPES.contains( attachedType ) ) { typeOk = true; }