mirror of https://github.com/apache/maven.git
o Fixed propagation of POM-level plugin dependencies to the plugin manager
git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@771481 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
31061189b0
commit
3659cbd249
|
@ -19,6 +19,8 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -424,8 +426,32 @@ public class DefaultArtifactResolver
|
|||
if ( request.isResolveTransitively() )
|
||||
{
|
||||
try
|
||||
{
|
||||
artifacts = source.retrieve( rootArtifact, localRepository, remoteRepositories ).getArtifacts();
|
||||
{
|
||||
Set<Artifact> directArtifacts =
|
||||
source.retrieve( rootArtifact, localRepository, remoteRepositories ).getArtifacts();
|
||||
|
||||
if ( artifacts == null || artifacts.isEmpty() )
|
||||
{
|
||||
artifacts = directArtifacts;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Artifact> allArtifacts = new ArrayList<Artifact>();
|
||||
allArtifacts.addAll( artifacts );
|
||||
allArtifacts.addAll( directArtifacts );
|
||||
|
||||
Map<String, Artifact> mergedArtifacts = new LinkedHashMap<String, Artifact>();
|
||||
for ( Artifact artifact : allArtifacts )
|
||||
{
|
||||
String conflictId = artifact.getDependencyConflictId();
|
||||
if ( !mergedArtifacts.containsKey( conflictId ) )
|
||||
{
|
||||
mergedArtifacts.put( conflictId, artifact );
|
||||
}
|
||||
}
|
||||
|
||||
artifacts = new LinkedHashSet<Artifact>( mergedArtifacts.values() );
|
||||
}
|
||||
}
|
||||
catch ( ArtifactMetadataRetrievalException e )
|
||||
{
|
||||
|
|
|
@ -468,15 +468,15 @@ public class DefaultLifecycleExecutor
|
|||
throw new LifecycleExecutionException( message );
|
||||
}
|
||||
|
||||
if ( plugin.getVersion() == null )
|
||||
for ( Plugin buildPlugin : project.getBuildPlugins() )
|
||||
{
|
||||
for ( Plugin buildPlugin : project.getBuildPlugins() )
|
||||
if ( buildPlugin.getKey().equals( plugin.getKey() ) )
|
||||
{
|
||||
if ( buildPlugin.getKey().equals( plugin.getKey() ) )
|
||||
if ( plugin.getVersion() == null || plugin.getVersion().equals( buildPlugin.getVersion() ) )
|
||||
{
|
||||
plugin = buildPlugin;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue