[GRADLE-3488] Add sourceSet.output to PMD classpath Created: 16/Jun/16  Updated: 25/Jan/17  Resolved: 16/Jun/16

Status: Resolved
Project: Gradle
Affects Version/s: 2.14-rc-6
Fix Version/s: 3.0-milestone-2, 3.0-rc-2

Type: Bug
Reporter: Marco Vermeulen Assignee: Marco Vermeulen
Resolution: Fixed Votes: 0

Attachments: Zip Archive bug-1468-gradle.zip    

 Description   

For the typeresolution feature in PMD it is necessary, that the compiled
classes of the project itself are on the "auxclasspath", too.

Currently, only sourceSet.compileClasspath is used. With this change, both sourceSet.output and sourceSet.compileClasspath will be used. The unit tests have been adjusted accordingly.

This problem has been found via pmd #1468, where you can find a complete sample project.

The workaround is, to configure pmdMain manually, e.g.:

pmdMain {
   classpath = files(sourceSets.main.compileClasspath, sourceSets.main.output)
}

This PR will make this configuration the default.

Source for failing sample code attached below.



 Comments   
Comment by Marco Vermeulen [ 16/Jun/16 ]

Has been merged with added integration test incorporating the sample code.

Links to Github issue #649.

Generated at Wed Jun 30 12:50:06 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.