Skip to content

Commit

Permalink
MNG-5214: Dependency resolution substitutes g:a:v:jar for j:a:v:somet…
Browse files Browse the repository at this point in the history
…hing-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
  • Loading branch information
bimargulies committed Dec 10, 2011
1 parent 04d269f commit 4b637c5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions maven-core/src/main/java/org/apache/maven/ReactorReader.java
Expand Up @@ -27,6 +27,7 @@

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
Expand All @@ -42,13 +43,16 @@
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;

private Map<String, List<MavenProject>> projectsByGA;

private WorkspaceRepository repository;

public ReactorReader( Map<String, MavenProject> reactorProjects )
{
projectsByGAV = reactorProjects;
Expand Down Expand Up @@ -99,7 +103,8 @@ else if ( !hasBeenPackaged( project ) )
}
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() );
}
Expand Down Expand Up @@ -194,11 +199,7 @@ else if ( requestedType.equals( attachedType ) )
{
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;
}
Expand Down

0 comments on commit 4b637c5

Please sign in to comment.