diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 6a09479..0362da9 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -14,7 +14,6 @@ import static rife.bld.dependencies.Scope.runtime; import static rife.bld.dependencies.Scope.test; import static rife.bld.operations.JavadocOptions.DocLinkOption.NO_MISSING; - public class PmdOperationBuild extends Project { public PmdOperationBuild() { pkg = "rife.bld.extension"; @@ -26,7 +25,7 @@ public class PmdOperationBuild extends Project { autoDownloadPurge = true; repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES); - var pmd = version(7, 0, 0, "rc2"); + var pmd = version(7, 0, 0, "rc3"); var rife2 = version(1,7,0); scope(compile) .include(dependency("com.uwyn.rife2", "rife2", rife2)) @@ -36,8 +35,8 @@ public class PmdOperationBuild extends Project { .include(dependency("net.sourceforge.pmd", "pmd-java", pmd)) .include(dependency("org.slf4j", "slf4j-simple", version(2,0,7))); scope(test) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 9, 3))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 9, 3))) + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0))) .include(dependency("org.assertj:assertj-joda-time:2.2.0")); javadocOperation() diff --git a/src/main/java/rife/bld/extension/PmdOperation.java b/src/main/java/rife/bld/extension/PmdOperation.java index b19514a..303bf43 100644 --- a/src/main/java/rife/bld/extension/PmdOperation.java +++ b/src/main/java/rife/bld/extension/PmdOperation.java @@ -66,10 +66,6 @@ public class PmdOperation extends AbstractOperation { * The cache location. */ Path cache; - /** - * The debug toggle. - */ - boolean debug; /** * The encoding. */ @@ -174,14 +170,6 @@ public class PmdOperation extends AbstractOperation { return this; } - /** - * Enables or disables debug logging mode. - */ - public PmdOperation debug(boolean debug) { - this.debug = debug; - return this; - } - /** * Sets the default language to be used for all input files. */ @@ -202,11 +190,9 @@ public class PmdOperation extends AbstractOperation { /** * Performs the PMD code analysis operation. - * - * @throws Exception when an exception occurs during the execution */ @Override - public void execute() throws Exception { + public void execute() { if (project == null) { throw new IllegalArgumentException("ERROR: project required."); } @@ -286,7 +272,6 @@ public class PmdOperation extends AbstractOperation { config.setAnalysisCacheLocation(cache.toFile().getAbsolutePath()); } - config.setDebug(debug); config.setFailOnViolation(failOnViolation); if (languageVersions != null) { @@ -363,7 +348,7 @@ public class PmdOperation extends AbstractOperation { for (var v : report.getViolations()) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "[{0}] {1}:{2}:\n\t{3} ({4})\n\t\t--> {5}", - new Object[]{commandName, Paths.get(v.getFilename()).toUri(), v.getBeginLine(), + new Object[]{commandName, Paths.get(v.getFileId().getFileName()).toUri(), v.getBeginLine(), v.getRule().getName(), v.getRule().getExternalInfoUrl() //TODO bug in PMD? .replace("${pmd.website.baseurl}", diff --git a/src/test/java/rife/bld/extension/PmdOperationTest.java b/src/test/java/rife/bld/extension/PmdOperationTest.java index e0c9ddd..cc61937 100644 --- a/src/test/java/rife/bld/extension/PmdOperationTest.java +++ b/src/test/java/rife/bld/extension/PmdOperationTest.java @@ -72,13 +72,6 @@ class PmdOperationTest { assertThat(f.delete()).as("delete file").isTrue(); } - @Test - void testDebug() { - var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).debug(true); - var config = pmd.initConfiguration(COMMAND_NAME); - assertThat(config.isDebug()).isTrue(); - } - @Test void testEncoding() { var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).encoding("UTF-16");