From d86043e9feb52cc6f8c936a51b66d4c2b80e6ce4 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sat, 3 Dec 2022 00:59:34 +0100 Subject: [PATCH] [MCHECKSTYLE-445] Upgrade to Doxia 2.0.0 Milestone Stack This closes #114 --- pom.xml | 12 ++--- .../MCHECKSTYLE-222-resources/verify.groovy | 2 +- .../verify.groovy | 2 +- src/it/MCHECKSTYLE-338/verify.groovy | 4 +- .../src/main/java/org/MyClass.java | 26 ---------- .../verify.groovy | 8 +-- src/it/MCHECKSTYLE-99/verify.groovy | 8 +-- src/it/checkstyle-goal/verify.groovy | 2 +- .../checkstyle/AbstractCheckstyleReport.java | 9 ++++ .../checkstyle/CheckstyleAggregateReport.java | 17 ------- .../plugins/checkstyle/CheckstyleReport.java | 7 --- .../AbstractCheckstyleTestCase.java | 49 +++++++++++++------ .../checkstyle/CheckstyleReportTest.java | 20 ++++---- .../stubs/CheckstyleProjectStub.java | 23 +++++++++ .../checkstyle/stubs/MinMavenProjectStub.java | 17 +++---- .../stubs/ModuleMavenProjectStub.java | 21 ++++---- .../stubs/MultiMavenProjectStub.java | 11 ++--- .../plugin-configs/custom-plugin-config.xml | 1 - ...dep-resolution-exception-plugin-config.xml | 1 - .../plugin-configs/min-plugin-config.xml | 1 - .../plugin-configs/no-files-plugin-config.xml | 1 - .../plugin-configs/no-rules-plugin-config.xml | 1 - .../no-severity-plugin-config.xml | 1 - .../test-source-directory-plugin-config.xml | 1 - .../plugin-configs/useFile-plugin-config.xml | 1 - 25 files changed, 116 insertions(+), 130 deletions(-) delete mode 100644 src/it/MCHECKSTYLE-412/src/main/java/org/MyClass.java diff --git a/pom.xml b/pom.xml index 8c7e9b85..f40d2cdc 100644 --- a/pom.xml +++ b/pom.xml @@ -77,10 +77,10 @@ under the License. 1.0.0.v20140518 3.2.5 9.3 - 1.11.1 - 1.11.1 - 3.12.1 - 3.3.0 + 2.0.0-M12 + 2.0.0-M19 + 4.0.0-M15 + 4.0.0-M1-SNAPSHOT 2023-10-21T10:39:27Z @@ -125,12 +125,12 @@ under the License. org.apache.maven.reporting maven-reporting-api - 3.1.1 + 4.0.0-M12 org.apache.maven.reporting maven-reporting-impl - 3.2.0 + 4.0.0-M15 diff --git a/src/it/MCHECKSTYLE-222-resources/verify.groovy b/src/it/MCHECKSTYLE-222-resources/verify.groovy index db588b99..0d9ff04e 100644 --- a/src/it/MCHECKSTYLE-222-resources/verify.groovy +++ b/src/it/MCHECKSTYLE-222-resources/verify.groovy @@ -17,6 +17,6 @@ * under the License. */ -assert new File(basedir, 'target/site/checkstyle.html').exists(); +assert new File(basedir, 'target/reports/checkstyle.html').exists(); return true; diff --git a/src/it/MCHECKSTYLE-222-testResources/verify.groovy b/src/it/MCHECKSTYLE-222-testResources/verify.groovy index db588b99..0d9ff04e 100644 --- a/src/it/MCHECKSTYLE-222-testResources/verify.groovy +++ b/src/it/MCHECKSTYLE-222-testResources/verify.groovy @@ -17,6 +17,6 @@ * under the License. */ -assert new File(basedir, 'target/site/checkstyle.html').exists(); +assert new File(basedir, 'target/reports/checkstyle.html').exists(); return true; diff --git a/src/it/MCHECKSTYLE-338/verify.groovy b/src/it/MCHECKSTYLE-338/verify.groovy index 71b05da1..6c606b9c 100644 --- a/src/it/MCHECKSTYLE-338/verify.groovy +++ b/src/it/MCHECKSTYLE-338/verify.groovy @@ -25,7 +25,7 @@ assert buildLog.text.contains( 'EmptyLogging: EmptyLoggingCheck on file TestFals assert !buildLog.text.contains( 'EmptyLogging: EmptyLoggingCheck on file TestTrue.java' ) // verify that the "checkstyle" goal does the same -site = new File( basedir, 'omitignoredmodules-false/target/site/checkstyle.html' ) +site = new File( basedir, 'omitignoredmodules-false/target/reports/checkstyle.html' ) assert site.text.contains( 'EmptyLoggingCheck on file TestFalse.java' ) -site = new File( basedir, 'omitignoredmodules-true/target/site/checkstyle.html' ) +site = new File( basedir, 'omitignoredmodules-true/target/reports/checkstyle.html' ) assert !site.text.contains( 'EmptyLoggingCheck on file TestTrue.java' ) diff --git a/src/it/MCHECKSTYLE-412/src/main/java/org/MyClass.java b/src/it/MCHECKSTYLE-412/src/main/java/org/MyClass.java deleted file mode 100644 index 1645c138..00000000 --- a/src/it/MCHECKSTYLE-412/src/main/java/org/MyClass.java +++ /dev/null @@ -1,26 +0,0 @@ -package org; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * My class. - */ -public class MyClass { -} diff --git a/src/it/MCHECKSTYLE-99-custom-xref-test-location/verify.groovy b/src/it/MCHECKSTYLE-99-custom-xref-test-location/verify.groovy index c0e8435c..e15f882e 100644 --- a/src/it/MCHECKSTYLE-99-custom-xref-test-location/verify.groovy +++ b/src/it/MCHECKSTYLE-99-custom-xref-test-location/verify.groovy @@ -18,9 +18,9 @@ * under the License. */ -site = new File( basedir, 'target/site/checkstyle.html' ) -assert site.exists(); -assert site.text.contains( '' ) -assert site.text.contains( '' ) +report = new File( basedir, 'target/reports/checkstyle.html' ) +assert report.exists(); +assert report.text.contains( '' ) +assert report.text.contains( '' ) return true; diff --git a/src/it/MCHECKSTYLE-99/verify.groovy b/src/it/MCHECKSTYLE-99/verify.groovy index 15675520..fc04c778 100644 --- a/src/it/MCHECKSTYLE-99/verify.groovy +++ b/src/it/MCHECKSTYLE-99/verify.groovy @@ -18,9 +18,9 @@ * under the License. */ -site = new File( basedir, 'target/site/checkstyle.html' ) -assert site.exists(); -assert site.text.contains( '' ) -assert site.text.contains( '' ) +report = new File( basedir, 'target/reports/checkstyle.html' ) +assert report.exists(); +assert report.text.contains( '' ) +assert report.text.contains( '' ) return true; diff --git a/src/it/checkstyle-goal/verify.groovy b/src/it/checkstyle-goal/verify.groovy index 9cdc38c0..22a61c4e 100644 --- a/src/it/checkstyle-goal/verify.groovy +++ b/src/it/checkstyle-goal/verify.groovy @@ -24,7 +24,7 @@ assert new File( basedir, 'target/checkstyle-checker.xml' ).exists(); assert new File( basedir, 'target/checkstyle-header.txt' ).exists(); assert new File( basedir, 'target/checkstyle-result.xml' ).exists(); -def html = new File( basedir, 'target/site/checkstyle.html' ).text; +def html = new File( basedir, 'target/reports/checkstyle.html' ).text; assert html.contains( '' ); return true; diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java index 51de7d93..57dade94 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java @@ -49,6 +49,7 @@ import org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorException; import org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorRequest; import org.apache.maven.plugins.checkstyle.exec.CheckstyleResults; +import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.reporting.MavenReportException; import org.codehaus.plexus.configuration.PlexusConfiguration; @@ -473,6 +474,14 @@ protected String getI18nString(Locale locale, String key) { return i18n.getString("checkstyle-report", locale, "report.checkstyle." + key); } + protected MavenProject getProject() { + return project; + } + + protected List getReactorProjects() { + return reactorProjects; + } + /** {@inheritDoc} */ public void executeReport(Locale locale) throws MavenReportException { checkDeprecatedParameterUsage(sourceDirectory, "sourceDirectory", "sourceDirectories"); diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleAggregateReport.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleAggregateReport.java index 0419d283..232e2486 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleAggregateReport.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleAggregateReport.java @@ -18,13 +18,9 @@ */ package org.apache.maven.plugins.checkstyle; -import java.util.List; - import org.apache.maven.plugins.annotations.Mojo; -import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorRequest; -import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.MavenReportException; /** @@ -40,19 +36,6 @@ requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true) public class CheckstyleAggregateReport extends AbstractCheckstyleReport { - /** - * The projects in the reactor for aggregation report. - * - * @since 2.8 - */ - @Parameter(property = "reactorProjects", readonly = true) - private List reactorProjects; - - /** {@inheritDoc} */ - protected MavenProject getProject() { - return project; - } - /** * {@inheritDoc} */ diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java index 15f16e04..ed575f4c 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java @@ -25,7 +25,6 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorRequest; -import org.apache.maven.project.MavenProject; import org.apache.maven.reporting.MavenReportException; /** @@ -39,12 +38,6 @@ */ @Mojo(name = "checkstyle", requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true) public class CheckstyleReport extends AbstractCheckstyleReport { - - /** {@inheritDoc} */ - protected MavenProject getProject() { - return project; - } - /** * {@inheritDoc} */ diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleTestCase.java b/src/test/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleTestCase.java index 9db52c9b..7aaa6fdc 100644 --- a/src/test/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleTestCase.java +++ b/src/test/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleTestCase.java @@ -21,9 +21,14 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.util.Locale; +import java.util.Collections; +import java.util.List; +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; @@ -39,8 +44,6 @@ * Abstract class to test reports generation. */ public abstract class AbstractCheckstyleTestCase extends AbstractMojoTestCase { - private Locale oldLocale; - private ArtifactStubFactory artifactStubFactory; /** @@ -53,21 +56,10 @@ protected void setUp() throws Exception { // required for mojo lookups to work super.setUp(); - oldLocale = Locale.getDefault(); - Locale.setDefault(Locale.ENGLISH); - artifactStubFactory = new DependencyArtifactStubFactory(getTestFile("target"), true, false); artifactStubFactory.getWorkingDir().mkdirs(); } - @Override - protected void tearDown() throws Exception { - super.tearDown(); - - Locale.setDefault(oldLocale); - oldLocale = null; - } - /** * Get the current Maven project * @@ -121,8 +113,17 @@ protected CheckstyleReport createReportMojo(String goal, File pluginXmlFile) thr 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; } @@ -148,4 +149,22 @@ protected File generateReport(CheckstyleReport mojo, File pluginXmlFile) throws protected String readFile(File checkstyleTestDir, String fileName) throws IOException { return new String(Files.readAllBytes(checkstyleTestDir.toPath().resolve(fileName))); } + + 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-checkstyle-plugin"); + pd.setPlugin(p); + md.setPluginDescriptor(pd); + + return me; + } + + protected abstract String getGoal(); } diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleReportTest.java b/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleReportTest.java index 13263304..038839b1 100644 --- a/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleReportTest.java +++ b/src/test/java/org/apache/maven/plugins/checkstyle/CheckstyleReportTest.java @@ -22,10 +22,10 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; -import java.util.Locale; import java.util.ResourceBundle; import org.apache.maven.artifact.DependencyResolutionRequiredException; +import org.apache.maven.doxia.tools.SiteTool; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.codehaus.plexus.util.FileUtils; @@ -35,11 +35,8 @@ */ public class CheckstyleReportTest extends AbstractCheckstyleTestCase { public void testNoSource() throws Exception { - // clean up after earlier runs - File report = new File("target/test-harness/checkstyle/no-source/checkstyle.html"); - report.delete(); - File generatedReport = generateReport("checkstyle", "no-source-plugin-config.xml"); - assertFalse(report + " exists", generatedReport.exists()); + File generatedReport = generateReport(getGoal(), "no-source-plugin-config.xml"); + assertFalse(FileUtils.fileExists(generatedReport.getAbsolutePath())); } public void testMinConfiguration() throws Exception { @@ -117,9 +114,9 @@ private String readFile(File file) throws IOException { private void generateReport(String pluginXml) throws Exception { File pluginXmlFile = new File(getBasedir(), "src/test/resources/plugin-configs/" + pluginXml); ResourceBundle bundle = - ResourceBundle.getBundle("checkstyle-report", Locale.getDefault(), this.getClassLoader()); + ResourceBundle.getBundle("checkstyle-report", SiteTool.DEFAULT_LOCALE, this.getClassLoader()); - CheckstyleReport mojo = createReportMojo("checkstyle", pluginXmlFile); + CheckstyleReport mojo = createReportMojo(getGoal(), pluginXmlFile); PluginDescriptor descriptorStub = new PluginDescriptor(); descriptorStub.setGroupId("org.apache.maven.plugins"); @@ -173,6 +170,11 @@ private void generateReport(String pluginXml) throws Exception { } private static String getHtmlHeader(String s) { - return ">" + s + ""; + return ">" + s + ""; + } + + @Override + protected String getGoal() { + return "checkstyle"; } } diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/CheckstyleProjectStub.java b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/CheckstyleProjectStub.java index 82e3d040..f85404bd 100644 --- a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/CheckstyleProjectStub.java +++ b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/CheckstyleProjectStub.java @@ -18,16 +18,34 @@ */ package org.apache.maven.plugins.checkstyle.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 CheckstyleProjectStub extends MavenProjectStub { + /** + * @return the POM file name + */ + protected abstract String getPOM(); + + @Override + public File getBasedir() { + return new File(super.getBasedir() + "/src/test/resources/plugin-configs/"); + } + + @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/java/org/apache/maven/plugins/checkstyle/stubs/MinMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MinMavenProjectStub.java index a9bb6caf..1dcaa0cb 100644 --- a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MinMavenProjectStub.java +++ b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MinMavenProjectStub.java @@ -18,7 +18,6 @@ */ package org.apache.maven.plugins.checkstyle.stubs; -import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -41,19 +40,19 @@ public List getCompileClasspathElements() throws DependencyResolutionReq /** {@inheritDoc} */ public List getTestClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList<>(getCompileClasspathElements()); - list.add("target/test-classes"); + list.add(getBasedir() + "/target/test-classes"); return list; } /** {@inheritDoc} */ public List getCompileSourceRoots() { - return Collections.singletonList("target/classes"); + return Collections.singletonList(getBasedir() + "/target/classes"); } /** {@inheritDoc} */ public List getTestCompileSourceRoots() { List list = new ArrayList<>(getCompileSourceRoots()); - list.add("target/test-classes"); + list.add(getBasedir() + "/target/test-classes"); return list; } @@ -84,15 +83,13 @@ public String getInceptionYear() { public Build getBuild() { Build build = new Build(); - build.setDirectory("target/test-harness/checkstyle/min"); + build.setDirectory(getBasedir() + "/target/test-harness/checkstyle/min"); return build; } - /** {@inheritDoc} */ - public File getFile() { - File file = new File(getBasedir(), "pom.xml"); - - return file; + @Override + protected String getPOM() { + return "min-plugin-config.xml"; } } diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/ModuleMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/ModuleMavenProjectStub.java index 4279abf9..4bc3136f 100644 --- a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/ModuleMavenProjectStub.java +++ b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/ModuleMavenProjectStub.java @@ -18,7 +18,6 @@ */ package org.apache.maven.plugins.checkstyle.stubs; -import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -42,19 +41,19 @@ public List getCompileClasspathElements() throws DependencyResolutionReq /** {@inheritDoc} */ public List getTestClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList<>(getCompileClasspathElements()); - list.add("target/test-classes"); + list.add(getBasedir() + "/target/test-classes"); return list; } /** {@inheritDoc} */ public List getCompileSourceRoots() { - return Collections.singletonList("target/classes"); + return Collections.singletonList(getBasedir() + "/target/classes"); } /** {@inheritDoc} */ public List getTestCompileSourceRoots() { List list = new ArrayList<>(getCompileSourceRoots()); - list.add("target/test-classes"); + list.add(getBasedir() + "/target/test-classes"); return list; } @@ -85,17 +84,15 @@ public String getInceptionYear() { public Build getBuild() { Build build = new Build(); - build.setDirectory("target/test-harness/checkstyle/multi"); - build.setSourceDirectory("src/test/test-sources"); - build.setTestSourceDirectory("src/test/java"); + build.setDirectory(getBasedir() + "/target/test-harness/checkstyle/multi"); + build.setSourceDirectory(getBasedir() + "/src/test/test-sources"); + build.setTestSourceDirectory(getBasedir() + "/src/test/java"); return build; } - /** {@inheritDoc} */ - public File getFile() { - File file = new File(getBasedir(), "pom.xml"); - - return file; + @Override + protected String getPOM() { + return "multi-plugin-config.xml"; } } diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MultiMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MultiMavenProjectStub.java index a0c5f946..20790ee4 100644 --- a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MultiMavenProjectStub.java +++ b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MultiMavenProjectStub.java @@ -18,7 +18,6 @@ */ package org.apache.maven.plugins.checkstyle.stubs; -import java.io.File; import java.util.Collections; import java.util.List; @@ -89,15 +88,13 @@ public String getInceptionYear() { public Build getBuild() { Build build = new Build(); - build.setDirectory("target/test-harness/checkstyle/multi"); + build.setDirectory(getBasedir() + "/target/test-harness/checkstyle/multi"); return build; } - /** {@inheritDoc} */ - public File getFile() { - File file = new File(getBasedir(), "pom.xml"); - - return file; + @Override + protected String getPOM() { + return "multi-plugin-config.xml"; } } diff --git a/src/test/resources/plugin-configs/custom-plugin-config.xml b/src/test/resources/plugin-configs/custom-plugin-config.xml index 830a9286..4d3703b0 100644 --- a/src/test/resources/plugin-configs/custom-plugin-config.xml +++ b/src/test/resources/plugin-configs/custom-plugin-config.xml @@ -28,7 +28,6 @@ under the License. maven-checkstyle-plugin ${basedir}/target/test-harness/checkstyle/custom - ${localRepository} true true true diff --git a/src/test/resources/plugin-configs/dep-resolution-exception-plugin-config.xml b/src/test/resources/plugin-configs/dep-resolution-exception-plugin-config.xml index 7d1c8cb0..aba1d2e4 100644 --- a/src/test/resources/plugin-configs/dep-resolution-exception-plugin-config.xml +++ b/src/test/resources/plugin-configs/dep-resolution-exception-plugin-config.xml @@ -24,7 +24,6 @@ under the License. maven-checkstyle-plugin ${basedir}/target/test-harness/checkstyle/dep-resolution - ${localRepository} true true true diff --git a/src/test/resources/plugin-configs/min-plugin-config.xml b/src/test/resources/plugin-configs/min-plugin-config.xml index 1cb1e8e9..b897fff6 100644 --- a/src/test/resources/plugin-configs/min-plugin-config.xml +++ b/src/test/resources/plugin-configs/min-plugin-config.xml @@ -28,7 +28,6 @@ under the License. maven-checkstyle-plugin ${basedir}/target/test-harness/checkstyle/min - ${localRepository} true true true diff --git a/src/test/resources/plugin-configs/no-files-plugin-config.xml b/src/test/resources/plugin-configs/no-files-plugin-config.xml index 49061c73..d09c3a9c 100644 --- a/src/test/resources/plugin-configs/no-files-plugin-config.xml +++ b/src/test/resources/plugin-configs/no-files-plugin-config.xml @@ -28,7 +28,6 @@ under the License. maven-checkstyle-plugin ${basedir}/target/test-harness/checkstyle/no-files - ${localRepository} true true false diff --git a/src/test/resources/plugin-configs/no-rules-plugin-config.xml b/src/test/resources/plugin-configs/no-rules-plugin-config.xml index a3795edd..60b4cd84 100644 --- a/src/test/resources/plugin-configs/no-rules-plugin-config.xml +++ b/src/test/resources/plugin-configs/no-rules-plugin-config.xml @@ -28,7 +28,6 @@ under the License. maven-checkstyle-plugin ${basedir}/target/test-harness/checkstyle/no-rules - ${localRepository} false true true diff --git a/src/test/resources/plugin-configs/no-severity-plugin-config.xml b/src/test/resources/plugin-configs/no-severity-plugin-config.xml index fb785b11..f65b18ab 100644 --- a/src/test/resources/plugin-configs/no-severity-plugin-config.xml +++ b/src/test/resources/plugin-configs/no-severity-plugin-config.xml @@ -28,7 +28,6 @@ under the License. maven-checkstyle-plugin ${basedir}/target/test-harness/checkstyle/no-severity - ${localRepository} true false true diff --git a/src/test/resources/plugin-configs/test-source-directory-plugin-config.xml b/src/test/resources/plugin-configs/test-source-directory-plugin-config.xml index 9ca9d037..79cf03a1 100644 --- a/src/test/resources/plugin-configs/test-source-directory-plugin-config.xml +++ b/src/test/resources/plugin-configs/test-source-directory-plugin-config.xml @@ -28,7 +28,6 @@ under the License. maven-checkstyle-plugin ${basedir}/target/test-harness/checkstyle/no-source - ${localRepository} true true true diff --git a/src/test/resources/plugin-configs/useFile-plugin-config.xml b/src/test/resources/plugin-configs/useFile-plugin-config.xml index f78464d3..acb5ba34 100644 --- a/src/test/resources/plugin-configs/useFile-plugin-config.xml +++ b/src/test/resources/plugin-configs/useFile-plugin-config.xml @@ -28,7 +28,6 @@ under the License. maven-checkstyle-plugin ${basedir}/target/test-harness/checkstyle/useFile - ${localRepository} true true true