Skip to content

Commit

Permalink
fix #28 by using new mechanism to set default pmd dependency
Browse files Browse the repository at this point in the history
Otherwise since Gradle 5.1. an UnsupportedOperationException is thrown
while addint the default dependency the "old" way. Reason is not 100%
clear but FindBugsPlugin uses this mechanism as well.
  • Loading branch information
aaschmid committed Jan 27, 2019
1 parent 533f59a commit 6e755b2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,9 @@ class CpdPlugin implements Plugin<Project> {
Configuration configuration = project.configurations.create('cpd')
configuration.with{
description = 'The CPD libraries to be used for this project.'
incoming.beforeResolve{
if (dependencies.isEmpty()) {
dependencies.add(project.dependencies.create("net.sourceforge.pmd:pmd-dist:${extension.toolVersion}"))
}

configuration.defaultDependencies{ d ->
d.add(project.getDependencies().create("net.sourceforge.pmd:pmd-dist:${extension.toolVersion}"))
}
transitive = true
visible = false
Expand Down

0 comments on commit 6e755b2

Please sign in to comment.