Regression in gradle 3.2-rc1 PMD plugin processing


(Thomas Jones-Low) #1

While using gradle 2.14.1 with the pmd plugin and PMD 5.1.2

:ckcqlclient:pmdIntegrationTest
:ckcqlclient:pmdMain
:ckcqlclient:pmdTest

If I change the Gradle version to 3.2-rc1 (no other changes) I get the following:

:ckcqlclient:pmdIntegrationTest
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/functional/com/apple/cloudkit/ckcqlclient/BasicCqlClientTest.java        -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/functional/com/apple/cloudkit/ckcqlclient/BasicCqlClientTest.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/functional/com/apple/cloudkit/ckcqlclient/CasseroleClientTest.java       -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/functional/com/apple/cloudkit/ckcqlclient/CasseroleClientTest.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/functional/com/apple/cloudkit/ckcqlclient/CqlCassandraClientTest.java    -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/functional/com/apple/cloudkit/ckcqlclient/CqlCassandraClientTest.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/functional/com/apple/cloudkit/ckcqlclient/CqlClientTimeoutTest.java      -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/functional/com/apple/cloudkit/ckcqlclient/CqlClientTimeoutTest.java
:ckcqlclient:pmdMain
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CKStatement.java   -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CKStatement.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CassandraClientProps.java  -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CassandraClientProps.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CassandraExceptions.java   -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CassandraExceptions.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CasseroleInfo.java -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CasseroleInfo.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ClientFactory.java -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ClientFactory.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CloudKitRetryPolicy.java   -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CloudKitRetryPolicy.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ClusterAndSession.java     -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ClusterAndSession.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ClusterInfo.java   -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ClusterInfo.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ColumnFamilyName.java      -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ColumnFamilyName.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ColumnSerializer.java      -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ColumnSerializer.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CorrelationsLogger.java    -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CorrelationsLogger.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlCassandraClient.java    -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlCassandraClient.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlExecutionContext.java   -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlExecutionContext.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlHubbleStats.java        -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlHubbleStats.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlInterceptor.java        -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlInterceptor.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlInterceptorBase.java    -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlInterceptorBase.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlLogging.java    -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlLogging.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlSamplingInterceptor.java        -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlSamplingInterceptor.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlSamplingLogger.java     -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/CqlSamplingLogger.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ExceptionLogger.java       -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ExceptionLogger.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/KeyspaceInfo.java  -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/KeyspaceInfo.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/RangeScanner.java  -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/RangeScanner.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ResultSetInterceptor.java  -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/ResultSetInterceptor.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/SlowQueryLog.java  -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/SlowQueryLog.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/Tracing.java       -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/Tracing.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/WrappedCassandraException.java     -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/src/com/apple/cloudkit/ckcqlclient/WrappedCassandraException.java
:ckcqlclient:pmdTest
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/unit/com/apple/cloudkit/ckcqlclient/CqlLoggingTest.java  -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/unit/com/apple/cloudkit/ckcqlclient/CqlLoggingTest.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/unit/com/apple/cloudkit/ckcqlclient/CqlSamplingLoggerTest.java   -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/unit/com/apple/cloudkit/ckcqlclient/CqlSamplingLoggerTest.java
/Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/unit/com/apple/cloudkit/ckcqlclient/TracingTest.java     -       Error while processing /Users/tjoneslo/Documents/workspace/liverpool/ckcqlclient/test/unit/com/apple/cloudkit/ckcqlclient/TracingTest.java

I’ve been unable to determine why a file does or does not appear on the list. I can not find a set of changes that causes one to be added to or removed from the list.

This also happens with 3.2-rc2. I’ve also tried using PMD 5.5.1 (latest release) with no change.


(Stefan Wolf) #2

Hi Thomas,

thank you for reporting. Does this also happen with Gradle 3.0 or Gradle 3.1?

Cheers,
Stefan


(Thomas Jones-Low) #3

Unfortunately I can’t try this is 3.1 because our build also encounters this issue: https://issues.gradle.org/browse/GRADLE-3568

I’ll spend some time to try and unpack this and isolate the case better.


(Stefan Wolf) #4

In order to test it with 3.0 you can try to use the workaround described in the Jira issue. I suppose that https://github.com/gradle/gradle/pull/649 would be the reason for these warnings. What does the generated PMD report look like? Is it fine?

Cheers,
Stefan


(Thomas Jones-Low) #5

I’ve confirmed the issue exists with Gradle 3.0 and 3.1

The HTML report has exactly the same information as the stdout. It has two columns, a file with the file name and a problem with the Error while processing <file>.


(Stefan Wolf) #6

Do all these files exist? Could you try to configure the classpath of the pmd<SourceSet> tasks to <sourceSet>.compileClasspath? You can try something along these lines:

sourceSets.all { sourceSet ->
    def pmdTask = tasks.getByName(sourceSet.getTaskName("pmd", null))
    pmdTask.classpath = sourceSet.compileClasspath
}

(Thomas Jones-Low) #7

The files do exist.

I’ve tried your suggestion, and it seems to have addressed the issue. That is, I’m no longer seeing the error messages, and PMD Errors that were occurring in 2.14.1 are now also being produced for 3.2-rc-2

Can you explain more why that change is required?


(Stefan Wolf) #8

By default, the classpath for the pmd task now contains the output of the source set it is testing (since 3.0). For some reason it seems like your .java files are part of the output and this is why the pmd tasks has problems processing those - it expects class files. At least this is my interpretation of your output. Do you configure that at some point in your build?

Cheers,
Stefan