diff --git a/pom.xml b/pom.xml
index 886efc73..f1e77b3b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@ under the License.
maven-pmd-plugin
- 3.21.3-SNAPSHOT
+ 4.0.0-M1-SNAPSHOT
maven-plugin
Apache Maven PMD Plugin
@@ -86,11 +86,10 @@ under the License.
6.55.0
1.7.36
1.0.0.v20140518
- 1.12.0
3.11.0
- 3.12.1
- 3.4.3
- 3.3.0
+ 4.0.0-M12
+ 4.0.0-M1-SNAPSHOT
+ 4.0.0-M1-SNAPSHOT
2023-10-30T21:06:38Z
@@ -158,7 +157,7 @@ under the License.
org.apache.commons
commons-lang3
- 3.12.0
+ 3.14.0
test
@@ -198,56 +197,14 @@ under the License.
org.apache.maven.doxia
doxia-sink-api
- ${doxiaVersion}
-
-
- org.codehaus.plexus
- plexus-container-default
-
-
-
-
- org.apache.maven.doxia
- doxia-core
- ${doxiaVersion}
-
-
- org.codehaus.plexus
- plexus-container-default
-
-
-
-
- org.apache.maven.doxia
- doxia-site-renderer
- 1.11.1
- runtime
-
-
-
- org.apache.httpcomponents
- httpclient
-
-
- org.codehaus.plexus
- plexus-container-default
-
-
- org.codehaus.plexus
- plexus-component-api
-
-
+ 2.0.0-M8
org.apache.maven.reporting
maven-reporting-impl
- 3.2.0
+ 4.0.0-M12
@@ -340,7 +297,7 @@ under the License.
commons-io
commons-io
- 2.11.0
+ 2.15.0
test
diff --git a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
index 4fd2a54f..7dc3878f 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
@@ -39,6 +39,7 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.ReportPlugin;
import org.apache.maven.model.Reporting;
+import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
@@ -241,12 +242,6 @@ public abstract class AbstractPmdReport extends AbstractMavenReport {
// Read-only parameters
// ----------------------------------------------------------------------
- /**
- * The projects in the reactor for aggregation report.
- */
- @Parameter(property = "reactorProjects", readonly = true)
- protected List reactorProjects;
-
/**
* The current build session instance. This is used for
* toolchain manager API calls and for dependency resolver API calls.
@@ -265,6 +260,14 @@ protected MavenProject getProject() {
return project;
}
+ protected List getReactorProjects() {
+ return reactorProjects;
+ }
+
+ protected MojoExecution getMojoExecution() {
+ return mojoExecution;
+ }
+
protected String constructXRefLocation(boolean test) {
String location = null;
if (linkXRef) {
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 c01fdbc4..03031af6 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
@@ -149,7 +149,6 @@ public void executeReport(Locale locale) throws MavenReportException {
@Override
public boolean canGenerateReport() {
if (skip) {
- getLog().info("Skipping CPD execution");
return false;
}
@@ -159,9 +158,6 @@ public boolean canGenerateReport() {
executeCpd();
if (skipEmptyReport) {
result = cpdResult.hasDuplications();
- if (!result) {
- getLog().debug("Skipping report since skipEmptyReport is true and there are no CPD issues.");
- }
}
} catch (MavenReportException e) {
throw new RuntimeException(e);
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 bd41e278..854d2dfe 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
@@ -315,7 +315,6 @@ public void executeReport(Locale locale) throws MavenReportException {
@Override
public boolean canGenerateReport() {
if (skip) {
- getLog().info("Skipping PMD execution");
return false;
}
@@ -325,10 +324,6 @@ public boolean canGenerateReport() {
executePmd();
if (skipEmptyReport) {
result = pmdResult.hasViolations();
- if (!result) {
- getLog().debug("Skipping report since skipEmptyReport is true and "
- + "there are no PMD violations.");
- }
}
} catch (MavenReportException e) {
throw new RuntimeException(e);
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 18a22597..3c4bfd34 100644
--- a/src/test/java/org/apache/maven/plugins/pmd/AbstractPmdReportTestCase.java
+++ b/src/test/java/org/apache/maven/plugins/pmd/AbstractPmdReportTestCase.java
@@ -21,9 +21,15 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
+import java.util.Collections;
+import java.util.List;
import java.util.Locale;
+import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.LegacySupport;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.plugin.testing.ArtifactStubFactory;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
@@ -110,8 +116,17 @@ protected AbstractPmdReport createReportMojo(String goal, File pluginXmlFile) th
repoSession.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory()
.newInstance(repoSession, new LocalRepository(artifactStubFactory.getWorkingDir())));
+ List reactorProjects =
+ mojo.getReactorProjects() != null ? mojo.getReactorProjects() : Collections.emptyList();
+
+ setVariableValueToObject(mojo, "mojoExecution", getMockMojoExecution());
setVariableValueToObject(mojo, "session", legacySupport.getSession());
- setVariableValueToObject(mojo, "remoteRepositories", mojo.getProject().getRemoteArtifactRepositories());
+ setVariableValueToObject(mojo, "repoSession", legacySupport.getRepositorySession());
+ setVariableValueToObject(mojo, "reactorProjects", reactorProjects);
+ setVariableValueToObject(
+ mojo, "remoteProjectRepositories", mojo.getProject().getRemoteProjectRepositories());
+ setVariableValueToObject(
+ mojo, "siteDirectory", new File(mojo.getProject().getBasedir(), "src/site"));
return mojo;
}
@@ -149,4 +164,22 @@ protected String readFile(File file) throws IOException {
public static boolean lowerCaseContains(String text, String contains) {
return text.toLowerCase(Locale.ROOT).contains(contains.toLowerCase(Locale.ROOT));
}
+
+ private MojoExecution getMockMojoExecution() {
+ MojoDescriptor md = new MojoDescriptor();
+ md.setGoal(getGoal());
+
+ MojoExecution me = new MojoExecution(md);
+
+ PluginDescriptor pd = new PluginDescriptor();
+ Plugin p = new Plugin();
+ p.setGroupId("org.apache.maven.plugins");
+ p.setArtifactId("maven-pmd-plugin");
+ pd.setPlugin(p);
+ md.setPluginDescriptor(pd);
+
+ return me;
+ }
+
+ protected abstract String getGoal();
}
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 b7657bf1..d32ea2fe 100644
--- a/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java
+++ b/src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java
@@ -22,7 +22,6 @@
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
-import java.util.Locale;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
@@ -39,7 +38,6 @@ public class CpdReportTest extends AbstractPmdReportTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
- Locale.setDefault(Locale.ENGLISH);
FileUtils.deleteDirectory(new File(getBasedir(), "target/test/unit"));
}
@@ -50,7 +48,7 @@ protected void setUp() throws Exception {
*/
public void testDefaultConfiguration() throws Exception {
File generatedReport =
- generateReport("cpd", "default-configuration/cpd-default-configuration-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/cpd-default-configuration-plugin-config.xml");
assertTrue(new File(generatedReport.getAbsolutePath()).exists());
// check if the CPD files were generated
@@ -75,7 +73,7 @@ public void testDefaultConfiguration() throws Exception {
* @throws Exception
*/
public void testTxtFormat() throws Exception {
- generateReport("cpd", "custom-configuration/cpd-txt-format-configuration-plugin-config.xml");
+ generateReport(getGoal(), "custom-configuration/cpd-txt-format-configuration-plugin-config.xml");
// check if the CPD files were generated
File generatedFile = new File(getBasedir(), "target/test/unit/custom-configuration/target/cpd.xml");
@@ -97,7 +95,8 @@ public void testTxtFormat() throws Exception {
* @throws Exception
*/
public void testCustomConfiguration() throws Exception {
- File generatedReport = generateReport("cpd", "custom-configuration/cpd-custom-configuration-plugin-config.xml");
+ File generatedReport =
+ generateReport(getGoal(), "custom-configuration/cpd-custom-configuration-plugin-config.xml");
assertTrue(new File(generatedReport.getAbsolutePath()).exists());
// check if the CPD files were generated
@@ -123,7 +122,7 @@ public void testInvalidFormat() throws Exception {
try {
File testPom = new File(
getBasedir(), "src/test/resources/unit/invalid-format/cpd-invalid-format-plugin-config.xml");
- AbstractPmdReport mojo = createReportMojo("cpd", testPom);
+ AbstractPmdReport mojo = createReportMojo(getGoal(), testPom);
setVariableValueToObject(
mojo, "compileSourceRoots", mojo.getProject().getCompileSourceRoots());
generateReport(mojo, testPom);
@@ -135,7 +134,7 @@ public void testInvalidFormat() throws Exception {
}
public void testWriteNonHtml() throws Exception {
- generateReport("cpd", "default-configuration/cpd-default-configuration-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/cpd-default-configuration-plugin-config.xml");
// check if the CPD files were generated
File generatedFile = new File(getBasedir(), "target/test/unit/default-configuration/target/cpd.xml");
@@ -157,7 +156,7 @@ public void testWriteNonHtml() throws Exception {
* @throws Exception
*/
public void testIncludeXmlInSite() throws Exception {
- generateReport("cpd", "default-configuration/cpd-report-include-xml-in-site-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/cpd-report-include-xml-in-site-plugin-config.xml");
File generatedFile = new File(getBasedir(), "target/test/unit/default-configuration/target/cpd.xml");
assertTrue(new File(generatedFile.getAbsolutePath()).exists());
@@ -178,13 +177,13 @@ public void testIncludeXmlInSite() throws Exception {
public void testSkipEmptyReportConfiguration() throws Exception {
// verify the generated files do not exist because PMD was skipped
- File generatedReport = generateReport("cpd", "empty-report/cpd-skip-empty-report-plugin-config.xml");
+ File generatedReport = generateReport(getGoal(), "empty-report/cpd-skip-empty-report-plugin-config.xml");
assertFalse(new File(generatedReport.getAbsolutePath()).exists());
}
public void testEmptyReportConfiguration() throws Exception {
// verify the generated files do exist, even if there are no violations
- File generatedReport = generateReport("cpd", "empty-report/cpd-empty-report-plugin-config.xml");
+ File generatedReport = generateReport(getGoal(), "empty-report/cpd-empty-report-plugin-config.xml");
assertTrue(new File(generatedReport.getAbsolutePath()).exists());
String str = readFile(generatedReport);
@@ -197,7 +196,7 @@ public void testCpdEncodingConfiguration() throws Exception {
try {
System.setProperty("file.encoding", "UTF-16");
- generateReport("cpd", "default-configuration/cpd-default-configuration-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/cpd-default-configuration-plugin-config.xml");
// check if the CPD files were generated
File generatedFile = new File(getBasedir(), "target/test/unit/default-configuration/target/cpd.xml");
@@ -210,7 +209,7 @@ public void testCpdEncodingConfiguration() throws Exception {
}
public void testCpdJavascriptConfiguration() throws Exception {
- generateReport("cpd", "default-configuration/cpd-javascript-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/cpd-javascript-plugin-config.xml");
// verify the generated file to exist and violations are reported
File generatedFile = new File(getBasedir(), "target/test/unit/default-configuration/target/cpd.xml");
@@ -221,7 +220,7 @@ public void testCpdJavascriptConfiguration() throws Exception {
}
public void testCpdJspConfiguration() throws Exception {
- generateReport("cpd", "default-configuration/cpd-jsp-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/cpd-jsp-plugin-config.xml");
// verify the generated file to exist and violations are reported
File generatedFile = new File(getBasedir(), "target/test/unit/default-configuration/target/cpd.xml");
@@ -232,7 +231,7 @@ public void testCpdJspConfiguration() throws Exception {
}
public void testExclusionsConfiguration() throws Exception {
- generateReport("cpd", "default-configuration/cpd-report-cpd-exclusions-configuration-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/cpd-report-cpd-exclusions-configuration-plugin-config.xml");
// verify the generated file to exist and no duplications are reported
File generatedFile = new File(getBasedir(), "target/test/unit/default-configuration/target/cpd.xml");
@@ -240,4 +239,9 @@ public void testExclusionsConfiguration() throws Exception {
String str = readFile(generatedFile);
assertEquals(0, StringUtils.countMatches(str, "UnusedPrivateField"));
// there should be the section Violations By Priority
- assertTrue(str.contains("Violations By Priority"));
- assertTrue(str.contains("Priority 3"));
- assertTrue(str.contains("Priority 4"));
+ assertTrue(str.contains("Violations By Priority"));
+ assertTrue(str.contains("Priority 3"));
+ assertTrue(str.contains("Priority 4"));
// the file App.java is mentioned 3 times: in prio 3, in prio 4 and in the files section
assertEquals(3, StringUtils.countMatches(str, "def/configuration/App.java"));
@@ -105,8 +103,8 @@ public void testDefaultConfigurationNotRenderRuleViolationPriority() throws Exce
new File(getBasedir(), "src/test/resources/unit/default-configuration/jxr-files"),
new File(getBasedir(), "target/test/unit/default-configuration/target/site"));
- File generatedReport =
- generateReport("pmd", "default-configuration/pmd-report-not-render-rule-priority-plugin-config.xml");
+ File generatedReport = generateReport(
+ getGoal(), "default-configuration/pmd-report-not-render-rule-priority-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
String str = readFile(generatedReport);
@@ -121,7 +119,7 @@ public void testDefaultConfigurationNoRenderViolationsByPriority() throws Except
new File(getBasedir(), "target/test/unit/default-configuration/target/site"));
File generatedReport =
- generateReport("pmd", "default-configuration/pmd-report-no-render-violations-by-priority.xml");
+ generateReport(getGoal(), "default-configuration/pmd-report-no-render-violations-by-priority.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
String str = readFile(generatedReport);
@@ -139,7 +137,7 @@ public void testDefaultConfigurationWithAnalysisCache() throws Exception {
new File(getBasedir(), "src/test/resources/unit/default-configuration/jxr-files"),
new File(getBasedir(), "target/test/unit/pmd-with-analysis-cache-plugin-config/target/site"));
- generateReport("pmd", "default-configuration/pmd-with-analysis-cache-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/pmd-with-analysis-cache-plugin-config.xml");
// check if the PMD analysis cache file has been generated
File cacheFile =
@@ -149,7 +147,7 @@ public void testDefaultConfigurationWithAnalysisCache() throws Exception {
public void testJavascriptConfiguration() throws Exception {
File generatedReport =
- generateReport("pmd", "default-configuration/javascript-configuration-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/javascript-configuration-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
// check if the PMD files were generated
@@ -180,7 +178,7 @@ public void testFileURL() throws Exception {
File testPom = new File(
getBasedir(), "src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml");
- PmdReport mojo = (PmdReport) createReportMojo("pmd", testPom);
+ PmdReport mojo = (PmdReport) createReportMojo(getGoal(), testPom);
// Additional test case for MPMD-174 (https://issues.apache.org/jira/browse/MPMD-174).
int port = determineFreePort();
@@ -270,7 +268,7 @@ private int determineFreePort() {
* @throws Exception
*/
public void testCustomConfiguration() throws Exception {
- File generatedReport = generateReport("pmd", "custom-configuration/custom-configuration-plugin-config.xml");
+ File generatedReport = generateReport(getGoal(), "custom-configuration/custom-configuration-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
// check the generated files
@@ -307,7 +305,7 @@ public void testCustomConfiguration() throws Exception {
* @throws Exception
*/
public void testSkipConfiguration() throws Exception {
- File generatedReport = generateReport("pmd", "custom-configuration/skip-plugin-config.xml");
+ File generatedReport = generateReport(getGoal(), "custom-configuration/skip-plugin-config.xml");
assertFalse(FileUtils.fileExists(generatedReport.getAbsolutePath()));
// verify the generated files do not exist because PMD was skipped
@@ -319,17 +317,17 @@ public void testSkipConfiguration() throws Exception {
// the fact, the PMD execution has been skipped, should be logged
String output = CapturingPrintStream.getOutput();
- assertTrue(output.contains("Skipping PMD execution"));
+ assertTrue(output.contains("Skipping org.apache.maven.plugins:maven-pmd-plugin"));
}
public void testSkipEmptyReportConfiguration() throws Exception {
// verify the generated files do not exist because PMD was skipped
- File generatedReport = generateReport("pmd", "empty-report/skip-empty-report-plugin-config.xml");
+ File generatedReport = generateReport(getGoal(), "empty-report/skip-empty-report-plugin-config.xml");
assertFalse(FileUtils.fileExists(generatedReport.getAbsolutePath()));
}
public void testEmptyReportConfiguration() throws Exception {
- File generatedReport = generateReport("pmd", "empty-report/empty-report-plugin-config.xml");
+ File generatedReport = generateReport(getGoal(), "empty-report/empty-report-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
// verify the generated files do exist, even if there are no violations
@@ -345,7 +343,7 @@ public void testInvalidFormat() throws Exception {
try {
File testPom =
new File(getBasedir(), "src/test/resources/unit/invalid-format/invalid-format-plugin-config.xml");
- AbstractPmdReport mojo = createReportMojo("pmd", testPom);
+ AbstractPmdReport mojo = createReportMojo(getGoal(), testPom);
setVariableValueToObject(
mojo, "compileSourceRoots", mojo.getProject().getCompileSourceRoots());
generateReport(mojo, testPom);
@@ -358,7 +356,7 @@ public void testInvalidFormat() throws Exception {
public void testInvalidTargetJdk() throws Exception {
try {
- generateReport("pmd", "empty-report/invalid-format/invalid-target-jdk-plugin-config.xml");
+ generateReport(getGoal(), "empty-report/invalid-format/invalid-target-jdk-plugin-config.xml");
fail("Must throw MavenReportException.");
} catch (Exception e) {
@@ -372,7 +370,7 @@ public void testInvalidTargetJdk() throws Exception {
*/
public void testIncludeXmlInSite() throws Exception {
File generatedReport =
- generateReport("pmd", "default-configuration/pmd-report-include-xml-in-site-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/pmd-report-include-xml-in-site-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
// verify the pmd file is included in site
@@ -396,7 +394,7 @@ public void testLocationTemp() throws Exception {
File testPom = new File(
getBasedir(), "src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml");
- PmdReport mojo = (PmdReport) lookupMojo("pmd", testPom);
+ PmdReport mojo = (PmdReport) lookupMojo(getGoal(), testPom);
assertEquals(
"locationTemp is not correctly encoding filename",
@@ -412,7 +410,8 @@ public void testLocationTemp() throws Exception {
* @throws Exception
*/
public void testSuppressMarkerConfiguration() throws Exception {
- File generatedReport = generateReport("pmd", "default-configuration/pmd-with-suppressMarker-plugin-config.xml");
+ File generatedReport =
+ generateReport(getGoal(), "default-configuration/pmd-with-suppressMarker-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
// check if the PMD files were generated
@@ -436,7 +435,7 @@ public void testSuppressMarkerConfiguration() throws Exception {
public void testSuppressMarkerConfigurationWithoutRendering() throws Exception {
File generatedReport =
- generateReport("pmd", "default-configuration/pmd-with-suppressMarker-no-render-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/pmd-with-suppressMarker-no-render-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
// check if the PMD files were generated
@@ -459,7 +458,7 @@ public void testSuppressMarkerConfigurationWithoutRendering() throws Exception {
}
public void testJspConfiguration() throws Exception {
- File generatedReport = generateReport("pmd", "default-configuration/jsp-configuration-plugin-config.xml");
+ File generatedReport = generateReport(getGoal(), "default-configuration/jsp-configuration-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
// check if the PMD files were generated
@@ -495,7 +494,7 @@ public void testJspConfiguration() throws Exception {
public void testPMDProcessingError() throws Exception {
try {
- generateReport("pmd", "processing-error/pmd-processing-error-plugin-config.xml");
+ generateReport(getGoal(), "processing-error/pmd-processing-error-plugin-config.xml");
fail("Expected exception");
} catch (RuntimeException e) {
assertTrue(e.getMessage().endsWith("Found 1 PMD processing errors"));
@@ -503,7 +502,8 @@ public void testPMDProcessingError() throws Exception {
}
public void testPMDProcessingErrorWithDetailsSkipped() throws Exception {
- File generatedReport = generateReport("pmd", "processing-error/pmd-processing-error-skip-plugin-config.xml");
+ File generatedReport =
+ generateReport(getGoal(), "processing-error/pmd-processing-error-skip-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
String output = CapturingPrintStream.getOutput();
@@ -523,7 +523,7 @@ public void testPMDProcessingErrorWithDetailsSkipped() throws Exception {
public void testPMDProcessingErrorWithDetailsNoReport() throws Exception {
File generatedReport =
- generateReport("pmd", "processing-error/pmd-processing-error-no-report-plugin-config.xml");
+ generateReport(getGoal(), "processing-error/pmd-processing-error-no-report-plugin-config.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
String output = CapturingPrintStream.getOutput();
@@ -542,7 +542,7 @@ public void testPMDProcessingErrorWithDetailsNoReport() throws Exception {
}
public void testPMDExcludeRootsShouldExcludeSubdirectories() throws Exception {
- generateReport("pmd", "exclude-roots/pmd-exclude-roots-plugin-config.xml");
+ generateReport(getGoal(), "exclude-roots/pmd-exclude-roots-plugin-config.xml");
File generatedFile = new File(getBasedir(), "target/test/unit/exclude-roots/target/pmd.xml");
assertTrue(FileUtils.fileExists(generatedFile.getAbsolutePath()));
@@ -557,7 +557,7 @@ public void testPMDExcludeRootsShouldExcludeSubdirectories() throws Exception {
}
public void testViolationExclusion() throws Exception {
- generateReport("pmd", "default-configuration/pmd-report-pmd-exclusions-configuration-plugin-config.xml");
+ generateReport(getGoal(), "default-configuration/pmd-report-pmd-exclusions-configuration-plugin-config.xml");
File generatedFile = new File(getBasedir(), "target/test/unit/default-configuration/target/pmd.xml");
assertTrue(FileUtils.fileExists(generatedFile.getAbsolutePath()));
@@ -582,13 +582,13 @@ public void testPmdReportCustomRulesNoExternalInfoUrl() throws Exception {
new File(getBasedir(), "src/test/resources/unit/default-configuration/jxr-files"),
new File(getBasedir(), "target/test/unit/default-configuration/target/site"));
- File generatedReport = generateReport("pmd", "default-configuration/pmd-report-custom-rules.xml");
+ File generatedReport = generateReport(getGoal(), "default-configuration/pmd-report-custom-rules.xml");
assertTrue(FileUtils.fileExists(generatedReport.getAbsolutePath()));
String str = readFile(generatedReport);
// custom rule without link
- assertEquals(2, StringUtils.countMatches(str, "CustomRule | "));
+ assertEquals(2, StringUtils.countMatches(str, "CustomRule | "));
// standard rule with link
assertEquals(4, StringUtils.countMatches(str, "\">UnusedPrivateField"));
}
@@ -635,7 +635,7 @@ public void testPmdReportResolveRulesets() throws Exception {
File testPom =
new File(getBasedir(), "src/test/resources/unit/default-configuration/pmd-report-resolve-rulesets.xml");
- PmdReport mojo = (PmdReport) createReportMojo("pmd", testPom);
+ PmdReport mojo = (PmdReport) createReportMojo(getGoal(), testPom);
mojo.rulesets[3] = sonarExportRulesetUrl;
mojo.rulesets[4] = myRulesetUrl;
mojo.rulesets[5] = notAInternalRulesetUrl;
@@ -670,4 +670,9 @@ public void testPmdReportResolveRulesets() throws Exception {
mockServer.stop();
}
+
+ @Override
+ protected String getGoal() {
+ return "pmd";
+ }
}
diff --git a/src/test/java/org/apache/maven/plugins/pmd/PmdViolationCheckMojoTest.java b/src/test/java/org/apache/maven/plugins/pmd/PmdViolationCheckMojoTest.java
index b47508b8..01d10df0 100644
--- a/src/test/java/org/apache/maven/plugins/pmd/PmdViolationCheckMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/pmd/PmdViolationCheckMojoTest.java
@@ -38,7 +38,7 @@ public void testDefaultConfiguration() throws Exception {
final File testPom = new File(
getBasedir(),
"src/test/resources/unit/default-configuration/pmd-check-default-configuration-plugin-config.xml");
- final PmdViolationCheckMojo mojo = (PmdViolationCheckMojo) lookupMojo("check", testPom);
+ final PmdViolationCheckMojo mojo = (PmdViolationCheckMojo) lookupMojo(getGoal(), testPom);
mojo.execute();
fail("MojoFailureException should be thrown.");
@@ -57,7 +57,7 @@ public void testNotFailOnViolation() throws Exception {
File testPom = new File(
getBasedir(),
"src/test/resources/unit/default-configuration/pmd-check-notfailonviolation-plugin-config.xml");
- final PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo("check", testPom);
+ final PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo(getGoal(), testPom);
pmdViolationMojo.execute();
assertTrue(true);
@@ -69,13 +69,13 @@ public void testMaxAllowedViolations() throws Exception {
File testPom = new File(
getBasedir(),
"src/test/resources/unit/default-configuration/pmd-check-notfailmaxviolation-plugin-config.xml");
- final PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo("check", testPom);
+ final PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo(getGoal(), testPom);
pmdViolationMojo.execute();
testPom = new File(
getBasedir(),
"src/test/resources/unit/default-configuration/pmd-check-failmaxviolation-plugin-config.xml");
- final PmdViolationCheckMojo pmdViolationMojoFail = (PmdViolationCheckMojo) lookupMojo("check", testPom);
+ final PmdViolationCheckMojo pmdViolationMojoFail = (PmdViolationCheckMojo) lookupMojo(getGoal(), testPom);
try {
pmdViolationMojoFail.execute();
@@ -97,13 +97,13 @@ public void testFailurePriority() throws Exception {
File testPom = new File(
getBasedir(),
"src/test/resources/unit/default-configuration/pmd-check-failonpriority-plugin-config.xml");
- PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo("check", testPom);
+ PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo(getGoal(), testPom);
pmdViolationMojo.execute();
testPom = new File(
getBasedir(),
"src/test/resources/unit/default-configuration/pmd-check-failandwarnonpriority-plugin-config.xml");
- pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo("check", testPom);
+ pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo(getGoal(), testPom);
try {
pmdViolationMojo.execute();
fail("Exception Expected");
@@ -123,7 +123,7 @@ public void testException() throws Exception {
final File testPom = new File(
getBasedir(),
"src/test/resources/unit/custom-configuration/pmd-check-exception-test-plugin-config.xml");
- final PmdViolationCheckMojo mojo = (PmdViolationCheckMojo) lookupMojo("check", testPom);
+ final PmdViolationCheckMojo mojo = (PmdViolationCheckMojo) lookupMojo(getGoal(), testPom);
mojo.execute();
fail("MojoFailureException should be thrown.");
@@ -138,9 +138,14 @@ public void testViolationExclusion() throws Exception {
File testPom = new File(
getBasedir(),
"src/test/resources/unit/default-configuration/pmd-check-pmd-exclusions-configuration-plugin-config.xml");
- final PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo("check", testPom);
+ final PmdViolationCheckMojo pmdViolationMojo = (PmdViolationCheckMojo) lookupMojo(getGoal(), testPom);
// this call shouldn't throw an exception, as the classes with violations have been excluded
pmdViolationMojo.execute();
}
+
+ @Override
+ protected String getGoal() {
+ return "check";
+ }
}
diff --git a/src/test/java/org/apache/maven/plugins/pmd/stubs/CustomConfigurationMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/pmd/stubs/CustomConfigurationMavenProjectStub.java
index 1d892b7f..1d79c445 100644
--- a/src/test/java/org/apache/maven/plugins/pmd/stubs/CustomConfigurationMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/pmd/stubs/CustomConfigurationMavenProjectStub.java
@@ -44,8 +44,7 @@ public CustomConfigurationMavenProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model = null;
- try (InputStream is = new FileInputStream(new File(getBasedir()
- + "/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml"))) {
+ try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) {
model = pomReader.read(is);
setModel(model);
} catch (Exception e) {
@@ -64,15 +63,15 @@ public CustomConfigurationMavenProjectStub() {
Build build = new Build();
build.setFinalName(model.getBuild().getFinalName());
- build.setDirectory(getBasedir() + "/target/test/unit/custom-configuration/target");
- build.setSourceDirectory(getBasedir() + "/src/test/resources/unit/custom-configuration");
+ build.setDirectory(getBasedir() + "/target");
+ build.setSourceDirectory(getBasedir().getAbsolutePath());
setBuild(build);
setReportPlugins(model.getReporting().getPlugins());
String basedir = getBasedir().getAbsolutePath();
List compileSourceRoots = new ArrayList<>();
- compileSourceRoots.add(basedir + "/src/test/resources/unit/custom-configuration/custom/configuration");
+ compileSourceRoots.add(basedir + "/custom/configuration");
setCompileSourceRoots(compileSourceRoots);
Artifact artifact = new PmdPluginArtifactStub(getGroupId(), getArtifactId(), getVersion(), getPackaging());
@@ -103,4 +102,14 @@ public void setReportPlugins(List plugins) {
public List getReportPlugins() {
return reportPlugins;
}
+
+ @Override
+ public File getBasedir() {
+ return new File(super.getBasedir() + "/custom-configuration");
+ }
+
+ @Override
+ protected String getPOM() {
+ return "custom-configuration-plugin-config.xml";
+ }
}
diff --git a/src/test/java/org/apache/maven/plugins/pmd/stubs/DefaultConfigurationMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/pmd/stubs/DefaultConfigurationMavenProjectStub.java
index e02a9a8b..ba1bc727 100644
--- a/src/test/java/org/apache/maven/plugins/pmd/stubs/DefaultConfigurationMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/pmd/stubs/DefaultConfigurationMavenProjectStub.java
@@ -44,8 +44,7 @@ public DefaultConfigurationMavenProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model = null;
- try (InputStream is = new FileInputStream(new File(getBasedir()
- + "/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml"))) {
+ try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) {
model = pomReader.read(is);
setModel(model);
} catch (Exception e) {
@@ -64,15 +63,15 @@ public DefaultConfigurationMavenProjectStub() {
Build build = new Build();
build.setFinalName(model.getBuild().getFinalName());
- build.setDirectory(getBasedir() + "/target/test/unit/default-configuration/target");
- build.setSourceDirectory(getBasedir() + "/src/test/resources/unit/default-configuration");
+ build.setDirectory(getBasedir() + "/target");
+ build.setSourceDirectory(getBasedir().getAbsolutePath());
setBuild(build);
setReportPlugins(model.getReporting().getPlugins());
String basedir = getBasedir().getAbsolutePath();
List compileSourceRoots = new ArrayList<>();
- compileSourceRoots.add(basedir + "/src/test/resources/unit/default-configuration/def/configuration");
+ compileSourceRoots.add(basedir + "/def/configuration");
setCompileSourceRoots(compileSourceRoots);
File file = new File(getBasedir().getAbsolutePath() + "/pom.xml");
@@ -104,4 +103,14 @@ public void setBuild(Build build) {
public Build getBuild() {
return build;
}
+
+ @Override
+ public File getBasedir() {
+ return new File(super.getBasedir() + "/default-configuration");
+ }
+
+ @Override
+ protected String getPOM() {
+ return "default-configuration-plugin-config.xml";
+ }
}
diff --git a/src/test/java/org/apache/maven/plugins/pmd/stubs/InvalidFormatMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/pmd/stubs/InvalidFormatMavenProjectStub.java
index 6e0a86dd..381fff93 100644
--- a/src/test/java/org/apache/maven/plugins/pmd/stubs/InvalidFormatMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/pmd/stubs/InvalidFormatMavenProjectStub.java
@@ -41,8 +41,7 @@ public InvalidFormatMavenProjectStub() {
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model = null;
- try (InputStream is = new FileInputStream(
- new File(getBasedir() + "/src/test/resources/unit/invalid-format/invalid-format-plugin-config.xml"))) {
+ try (InputStream is = new FileInputStream(new File(getBasedir() + "/" + getPOM()))) {
model = pomReader.read(is);
setModel(model);
} catch (Exception e) {
@@ -61,13 +60,13 @@ public InvalidFormatMavenProjectStub() {
Build build = new Build();
build.setFinalName(model.getBuild().getFinalName());
- build.setDirectory(getBasedir() + "/target/test/unit/invalid-format/target");
- build.setSourceDirectory(getBasedir() + "/src/test/resources/unit/invalid-format");
+ build.setDirectory(getBasedir() + "/target");
+ build.setSourceDirectory(getBasedir().getAbsolutePath());
setBuild(build);
String basedir = getBasedir().getAbsolutePath();
List compileSourceRoots = new ArrayList<>();
- compileSourceRoots.add(basedir + "/src/test/resources/unit/invalid-format/invalid/format");
+ compileSourceRoots.add(basedir + "/invalid/format");
setCompileSourceRoots(compileSourceRoots);
Artifact artifact = new PmdPluginArtifactStub(getGroupId(), getArtifactId(), getVersion(), getPackaging());
@@ -88,4 +87,14 @@ public void setBuild(Build build) {
public Build getBuild() {
return build;
}
+
+ @Override
+ public File getBasedir() {
+ return new File(super.getBasedir() + "/invalid-format");
+ }
+
+ @Override
+ protected String getPOM() {
+ return "invalid-format-plugin-config.xml";
+ }
}
diff --git a/src/test/java/org/apache/maven/plugins/pmd/stubs/PmdProjectStub.java b/src/test/java/org/apache/maven/plugins/pmd/stubs/PmdProjectStub.java
index fd34c4f6..1a0d86f1 100644
--- a/src/test/java/org/apache/maven/plugins/pmd/stubs/PmdProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/pmd/stubs/PmdProjectStub.java
@@ -18,16 +18,34 @@
*/
package org.apache.maven.plugins.pmd.stubs;
+import java.io.File;
import java.util.Collections;
import java.util.List;
+import org.apache.maven.RepositoryUtils;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.artifact.repository.MavenArtifactRepository;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+import org.eclipse.aether.repository.RemoteRepository;
public abstract class PmdProjectStub extends MavenProjectStub {
+ /**
+ * @return the POM file name
+ */
+ protected abstract String getPOM();
+
+ @Override
+ public File getBasedir() {
+ return new File(super.getBasedir() + "/src/test/resources/unit/");
+ }
+
+ @Override
+ public File getFile() {
+ return new File(getBasedir(), getPOM());
+ }
+
@Override
public List getRemoteArtifactRepositories() {
ArtifactRepository repository = new MavenArtifactRepository(
@@ -39,4 +57,9 @@ public List getRemoteArtifactRepositories() {
return Collections.singletonList(repository);
}
+
+ @Override
+ public List getRemoteProjectRepositories() {
+ return RepositoryUtils.toRepos(getRemoteArtifactRepositories());
+ }
}
diff --git a/src/test/resources/unit/custom-configuration/cpd-custom-configuration-plugin-config.xml b/src/test/resources/unit/custom-configuration/cpd-custom-configuration-plugin-config.xml
index 35955898..6fd8a79e 100644
--- a/src/test/resources/unit/custom-configuration/cpd-custom-configuration-plugin-config.xml
+++ b/src/test/resources/unit/custom-configuration/cpd-custom-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/custom-configuration/target/site
${basedir}/target/test/unit/custom-configuration/target
- ${localRepository}
csv
false
${basedir}/target/test/unit/custom-configuration/target/site/xref
diff --git a/src/test/resources/unit/custom-configuration/cpd-txt-format-configuration-plugin-config.xml b/src/test/resources/unit/custom-configuration/cpd-txt-format-configuration-plugin-config.xml
index eb7d1fe3..ffc29032 100644
--- a/src/test/resources/unit/custom-configuration/cpd-txt-format-configuration-plugin-config.xml
+++ b/src/test/resources/unit/custom-configuration/cpd-txt-format-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/custom-configuration/target/site
${basedir}/target/test/unit/custom-configuration/target
- ${localRepository}
txt
false
30
diff --git a/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml b/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml
index 8cfd6ef5..d1ff3f43 100644
--- a/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml
+++ b/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/custom-configuration/target/site
${basedir}/target/test/unit/custom-configuration/target
- ${localRepository}
${basedir}/target/test/unit/custom-configuration/target/pmd/rulesets
csv
true
diff --git a/src/test/resources/unit/default-configuration/cpd-default-configuration-plugin-config.xml b/src/test/resources/unit/default-configuration/cpd-default-configuration-plugin-config.xml
index e57fe5d3..a201c3ee 100644
--- a/src/test/resources/unit/default-configuration/cpd-default-configuration-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/cpd-default-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
xml
false
${basedir}/target/test/unit/default-configuration/target/site/xref
diff --git a/src/test/resources/unit/default-configuration/cpd-javascript-plugin-config.xml b/src/test/resources/unit/default-configuration/cpd-javascript-plugin-config.xml
index f7e045ad..089fb484 100644
--- a/src/test/resources/unit/default-configuration/cpd-javascript-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/cpd-javascript-plugin-config.xml
@@ -35,7 +35,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
xml
false
${basedir}/target/test/unit/default-configuration/target/site/xref
diff --git a/src/test/resources/unit/default-configuration/cpd-jsp-plugin-config.xml b/src/test/resources/unit/default-configuration/cpd-jsp-plugin-config.xml
index 6ad62d0b..3cb44b30 100644
--- a/src/test/resources/unit/default-configuration/cpd-jsp-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/cpd-jsp-plugin-config.xml
@@ -35,7 +35,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
xml
false
${basedir}/target/test/unit/default-configuration/target/site/xref
diff --git a/src/test/resources/unit/default-configuration/cpd-report-cpd-exclusions-configuration-plugin-config.xml b/src/test/resources/unit/default-configuration/cpd-report-cpd-exclusions-configuration-plugin-config.xml
index 85ea1918..76efc020 100644
--- a/src/test/resources/unit/default-configuration/cpd-report-cpd-exclusions-configuration-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/cpd-report-cpd-exclusions-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
xml
false
${basedir}/target/test/unit/default-configuration/target/site/xref
diff --git a/src/test/resources/unit/default-configuration/cpd-report-include-xml-in-site-plugin-config.xml b/src/test/resources/unit/default-configuration/cpd-report-include-xml-in-site-plugin-config.xml
index 7920f0a4..e2ced38b 100644
--- a/src/test/resources/unit/default-configuration/cpd-report-include-xml-in-site-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/cpd-report-include-xml-in-site-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
xml
false
${basedir}/target/test/unit/default-configuration/target/site/xref
diff --git a/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml b/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml
index 36e22ec5..fb99dbf1 100644
--- a/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
true
diff --git a/src/test/resources/unit/default-configuration/javascript-configuration-plugin-config.xml b/src/test/resources/unit/default-configuration/javascript-configuration-plugin-config.xml
index 24457540..791540f1 100644
--- a/src/test/resources/unit/default-configuration/javascript-configuration-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/javascript-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
UTF-8
diff --git a/src/test/resources/unit/default-configuration/jsp-configuration-plugin-config.xml b/src/test/resources/unit/default-configuration/jsp-configuration-plugin-config.xml
index 0de51597..a0fa7f44 100644
--- a/src/test/resources/unit/default-configuration/jsp-configuration-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/jsp-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
UTF-8
diff --git a/src/test/resources/unit/default-configuration/pmd-report-custom-rules.xml b/src/test/resources/unit/default-configuration/pmd-report-custom-rules.xml
index b5f9c4dd..c737e21c 100644
--- a/src/test/resources/unit/default-configuration/pmd-report-custom-rules.xml
+++ b/src/test/resources/unit/default-configuration/pmd-report-custom-rules.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
${basedir}/src/test/resources/unit/default-configuration/rulesets/custom-rules.xml
diff --git a/src/test/resources/unit/default-configuration/pmd-report-include-xml-in-site-plugin-config.xml b/src/test/resources/unit/default-configuration/pmd-report-include-xml-in-site-plugin-config.xml
index e62b70ce..8cb25945 100644
--- a/src/test/resources/unit/default-configuration/pmd-report-include-xml-in-site-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/pmd-report-include-xml-in-site-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
UTF-8
diff --git a/src/test/resources/unit/default-configuration/pmd-report-no-render-violations-by-priority.xml b/src/test/resources/unit/default-configuration/pmd-report-no-render-violations-by-priority.xml
index a9db808a..9194f6f9 100644
--- a/src/test/resources/unit/default-configuration/pmd-report-no-render-violations-by-priority.xml
+++ b/src/test/resources/unit/default-configuration/pmd-report-no-render-violations-by-priority.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
true
diff --git a/src/test/resources/unit/default-configuration/pmd-report-not-render-rule-priority-plugin-config.xml b/src/test/resources/unit/default-configuration/pmd-report-not-render-rule-priority-plugin-config.xml
index f2633ce2..572a5e1e 100644
--- a/src/test/resources/unit/default-configuration/pmd-report-not-render-rule-priority-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/pmd-report-not-render-rule-priority-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
true
diff --git a/src/test/resources/unit/default-configuration/pmd-report-pmd-exclusions-configuration-plugin-config.xml b/src/test/resources/unit/default-configuration/pmd-report-pmd-exclusions-configuration-plugin-config.xml
index 246d4952..3387d3ed 100644
--- a/src/test/resources/unit/default-configuration/pmd-report-pmd-exclusions-configuration-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/pmd-report-pmd-exclusions-configuration-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
true
diff --git a/src/test/resources/unit/default-configuration/pmd-report-resolve-rulesets.xml b/src/test/resources/unit/default-configuration/pmd-report-resolve-rulesets.xml
index a36a855f..74441e29 100644
--- a/src/test/resources/unit/default-configuration/pmd-report-resolve-rulesets.xml
+++ b/src/test/resources/unit/default-configuration/pmd-report-resolve-rulesets.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
${basedir}/src/test/resources/unit/default-configuration/rulesets/custom-rules.xml
diff --git a/src/test/resources/unit/default-configuration/pmd-with-analysis-cache-plugin-config.xml b/src/test/resources/unit/default-configuration/pmd-with-analysis-cache-plugin-config.xml
index df2c0f19..642f124e 100644
--- a/src/test/resources/unit/default-configuration/pmd-with-analysis-cache-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/pmd-with-analysis-cache-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/pmd-with-analysis-cache-plugin-config/target/site
${basedir}/target/test/unit/pmd-with-analysis-cache-plugin-config/target
- ${localRepository}
${basedir}/target/test/unit/pmd-with-analysis-cache-plugin-config/target/pmd/rulesets
xml
true
diff --git a/src/test/resources/unit/default-configuration/pmd-with-suppressMarker-no-render-plugin-config.xml b/src/test/resources/unit/default-configuration/pmd-with-suppressMarker-no-render-plugin-config.xml
index 9ed62576..d3889696 100644
--- a/src/test/resources/unit/default-configuration/pmd-with-suppressMarker-no-render-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/pmd-with-suppressMarker-no-render-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
true
diff --git a/src/test/resources/unit/default-configuration/pmd-with-suppressMarker-plugin-config.xml b/src/test/resources/unit/default-configuration/pmd-with-suppressMarker-plugin-config.xml
index c5116dd9..efd85233 100644
--- a/src/test/resources/unit/default-configuration/pmd-with-suppressMarker-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/pmd-with-suppressMarker-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/default-configuration/target/site
${basedir}/target/test/unit/default-configuration/target
- ${localRepository}
${basedir}/target/test/unit/default-configuration/target/pmd/rulesets
xml
true
diff --git a/src/test/resources/unit/empty-report/cpd-empty-report-plugin-config.xml b/src/test/resources/unit/empty-report/cpd-empty-report-plugin-config.xml
index be2b5348..e0001ecb 100644
--- a/src/test/resources/unit/empty-report/cpd-empty-report-plugin-config.xml
+++ b/src/test/resources/unit/empty-report/cpd-empty-report-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/empty-report/target/site
${basedir}/target/test/unit/empty-report/target
- ${localRepository}
${basedir}/src/test/resources/unit/empty-report/java/
diff --git a/src/test/resources/unit/empty-report/empty-report-plugin-config.xml b/src/test/resources/unit/empty-report/empty-report-plugin-config.xml
index c1c6ea8e..00c24f08 100644
--- a/src/test/resources/unit/empty-report/empty-report-plugin-config.xml
+++ b/src/test/resources/unit/empty-report/empty-report-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/empty-report/target/site
${basedir}/target/test/unit/empty-report/target
- ${localRepository}
${basedir}/target/test/unit/empty-report/target/pmd/rulesets
${basedir}/src/test/resources/unit/empty-report/java/
diff --git a/src/test/resources/unit/exclude-roots/pmd-exclude-roots-plugin-config.xml b/src/test/resources/unit/exclude-roots/pmd-exclude-roots-plugin-config.xml
index ac800c73..bec142fe 100644
--- a/src/test/resources/unit/exclude-roots/pmd-exclude-roots-plugin-config.xml
+++ b/src/test/resources/unit/exclude-roots/pmd-exclude-roots-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/exclude-roots/target/site
${basedir}/target/test/unit/exclude-roots/target
- ${localRepository}
${basedir}/target/test/unit/exclude-roots/target/pmd/rulesets
xml
UTF-8
diff --git a/src/test/resources/unit/processing-error/pmd-processing-error-no-report-plugin-config.xml b/src/test/resources/unit/processing-error/pmd-processing-error-no-report-plugin-config.xml
index ba7f86f9..40f087f2 100644
--- a/src/test/resources/unit/processing-error/pmd-processing-error-no-report-plugin-config.xml
+++ b/src/test/resources/unit/processing-error/pmd-processing-error-no-report-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/parse-error/target/site
${basedir}/target/test/unit/parse-error/target
- ${localRepository}
${basedir}/target/test/unit/parse-error/target/pmd/rulesets
xml
UTF-8
diff --git a/src/test/resources/unit/processing-error/pmd-processing-error-skip-plugin-config.xml b/src/test/resources/unit/processing-error/pmd-processing-error-skip-plugin-config.xml
index 686d7052..55c8a4d9 100644
--- a/src/test/resources/unit/processing-error/pmd-processing-error-skip-plugin-config.xml
+++ b/src/test/resources/unit/processing-error/pmd-processing-error-skip-plugin-config.xml
@@ -36,7 +36,6 @@ under the License.
${basedir}/target/test/unit/parse-error/target/site
${basedir}/target/test/unit/parse-error/target
- ${localRepository}
${basedir}/target/test/unit/parse-error/target/pmd/rulesets
xml
UTF-8