Skip to content

Commit 5376261

Browse files
committed
[SUREFIRE-1564] Can't override platform version through project/plugin dependencies
1 parent 242c0e8 commit 5376261

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,8 +1777,23 @@ private static Set<Artifact> retainInProcArtifactsUnique( Set<Artifact> provider
17771777
Artifact... inPluginArtifacts )
17781778
{
17791779
Set<Artifact> result = new LinkedHashSet<Artifact>();
1780-
addAll( result, inPluginArtifacts );
1781-
result.removeAll( providerArtifacts );
1780+
for ( Artifact inPluginArtifact : inPluginArtifacts )
1781+
{
1782+
boolean contains = false;
1783+
for ( Artifact providerArtifact : providerArtifacts )
1784+
{
1785+
if ( providerArtifact.getGroupId().equals( inPluginArtifact.getGroupId() )
1786+
&& providerArtifact.getArtifactId().equals( inPluginArtifact.getArtifactId() ) )
1787+
{
1788+
contains = true;
1789+
break;
1790+
}
1791+
}
1792+
if ( !contains )
1793+
{
1794+
result.add( inPluginArtifact );
1795+
}
1796+
}
17821797
return result;
17831798
}
17841799

0 commit comments

Comments
 (0)