MNG-5214: Dependency resolution substitutes g🅰️v:jar for j🅰️v:something-else when something-else isn't in the reactor

o allow ejb-client types artifacts to dance with jar artifacts to allow reactor resolution to target/classes, thus
unbreaking some integration tests.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1212793 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benson Margulies 2011-12-10 13:54:49 +00:00
parent 04d269f1da
commit 4b637c5a2f
1 changed files with 8 additions and 7 deletions

View File

@ -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,6 +43,9 @@ import java.util.Map;
class ReactorReader
implements WorkspaceReader
{
private final static Collection<String> JAR_LIKE_TYPES = Arrays.asList( "jar", "test-jar", "ejb-client" );
private final static Collection<String> COMPILE_PHASE_TYPES = Arrays.asList( "jar", "ejb-client" );
private Map<String, MavenProject> projectsByGAV;
@ -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;
}