This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch name in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git
commit 58908a4d7a0b135977ee59dedb9c3367247924c9 Author: Elliotte Rusty Harold <elh...@ibiblio.org> AuthorDate: Sun Dec 15 07:28:38 2024 -0500 [MPMD-411] IN progress do not review --- src/main/java/org/apache/maven/plugins/pmd/CpdReport.java | 7 +++++++ src/main/java/org/apache/maven/plugins/pmd/PmdReport.java | 6 ++++++ .../org/apache/maven/plugins/pmd/AbstractPmdReportTestCase.java | 2 +- src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java b/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java index 3ba1b7d..11e244d 100644 --- a/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java +++ b/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java @@ -210,7 +210,14 @@ public class CpdReport extends AbstractPmdReport { /** * {@inheritDoc} */ + @Override + @Deprecated public String getOutputName() { return "cpd"; } + + @Override + public String getOutputPath() { + return "pmd"; + } } diff --git a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java index b3bf3e9..d5d2730 100644 --- a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java +++ b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java @@ -543,10 +543,16 @@ public class PmdReport extends AbstractPmdReport { * {@inheritDoc} */ @Override + @Deprecated public String getOutputName() { return "pmd"; } + @Override + public String getOutputPath() { + return "pmd"; + } + /** * Create and return the correct renderer for the output type. * diff --git a/src/test/java/org/apache/maven/plugins/pmd/AbstractPmdReportTestCase.java b/src/test/java/org/apache/maven/plugins/pmd/AbstractPmdReportTestCase.java index 3c4bfd3..8b4f5e8 100644 --- a/src/test/java/org/apache/maven/plugins/pmd/AbstractPmdReportTestCase.java +++ b/src/test/java/org/apache/maven/plugins/pmd/AbstractPmdReportTestCase.java @@ -141,7 +141,7 @@ public abstract class AbstractPmdReportTestCase extends AbstractMojoTestCase { testMavenProject = builder.build(pluginXmlFile, buildingRequest).getProject(); File outputDir = mojo.getReportOutputDirectory(); - String filename = mojo.getOutputName() + ".html"; + String filename = mojo.getOutputPath() + ".html"; return new File(outputDir, filename); } diff --git a/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java b/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java index 4d6ac98..231619a 100644 --- a/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java +++ b/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java @@ -182,7 +182,7 @@ public class CpdReportTest extends AbstractPmdReportTestCase { public void testEmptyReportConfiguration() throws Exception { // verify the generated files do exist, even if there are no violations File generatedReport = generateReport(getGoal(), "empty-report/cpd-empty-report-plugin-config.xml"); - assertTrue(new File(generatedReport.getAbsolutePath()).exists()); + assertTrue(generatedReport.getAbsolutePath() + " does not exist", new File(generatedReport.getAbsolutePath()).exists()); String str = readFile(generatedReport); assertFalse(lowerCaseContains(str, "Hello.java"));