Fix Gradle plugin logic for removing provided artifacts

The new ResolvedArtifact-based minus implementation was checking the
wrong Set when deciding whether or not a ResolvedArtifact should
be included in the result. This was leading to provided dependencies,
that should have only been packaging in WEB-INF/lib-provided also
being packaged in WEB-INF/lib.

The WarPackaging tests have been updated. In addition to checking that
WEB-INF/lib-provided does not contain anything that’s unexpected, they
also verify the contents of WEB-INF/lib

Fixes #1187
This commit is contained in:
Andy Wilkinson
2014-06-30 14:19:03 +01:00
parent e306cff4ff
commit 53be0f8db7
2 changed files with 66 additions and 31 deletions

View File

@@ -112,7 +112,7 @@ class ProjectLibraries implements Libraries {
}
Set<ResolvedArtifact> result = new LinkedHashSet<ResolvedArtifact>();
for (ResolvedArtifact artifact : source) {
if (!toRemove.contains(artifact.getFile())) {
if (!filesToRemove.contains(artifact.getFile())) {
result.add(artifact);
}
}