From b08abc20d963f41b1510e12136f0f09853f9e14c Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 14 May 2023 20:09:33 +0200 Subject: [PATCH] [MCHECKSTYLE-435] Remove deprecated RSS feature This closes #117 --- pom.xml | 26 ---- .../pom.xml | 3 - .../verify.groovy | 3 - src/it/MCHECKSTYLE-357/pom.xml | 3 - src/it/MCHECKSTYLE-357/verify.groovy | 3 - src/it/checkstyle-goal/pom.xml | 3 - src/it/checkstyle-goal/verify.groovy | 15 +-- src/it/checkstyle-report/pom.xml | 3 - src/it/checkstyle-report/verify.groovy | 16 +-- .../checkstyle/AbstractCheckstyleReport.java | 57 --------- .../checkstyle/CheckstyleReportGenerator.java | 26 ---- .../plugins/checkstyle/ReportResource.java | 66 ---------- .../rss/CheckstyleRssGenerator.java | 32 ----- .../rss/CheckstyleRssGeneratorRequest.java | 78 ------------ .../rss/DefaultCheckstyleRssGenerator.java | 74 ----------- .../checkstyle/rss/VelocityTemplate.java | 119 ------------------ .../plugins/checkstyle/checkstyle-rss.vm | 74 ----------- .../maven/plugins/checkstyle/images/rss.png | Bin 360 -> 0 bytes .../checkstyle/CheckstyleReportTest.java | 6 - .../checkstyle/ReportResourceTest.java | 55 -------- .../plugin-configs/custom-plugin-config.xml | 1 - ...dep-resolution-exception-plugin-config.xml | 1 - .../fail-on-error-plugin-config.xml | 1 - .../plugin-configs/min-plugin-config.xml | 1 - .../plugin-configs/multi-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 - .../no-source-plugin-config.xml | 1 - .../test-source-directory-plugin-config.xml | 1 - .../plugin-configs/useFile-plugin-config.xml | 1 - 31 files changed, 2 insertions(+), 671 deletions(-) delete mode 100644 src/main/java/org/apache/maven/plugins/checkstyle/ReportResource.java delete mode 100644 src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGenerator.java delete mode 100644 src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGeneratorRequest.java delete mode 100644 src/main/java/org/apache/maven/plugins/checkstyle/rss/DefaultCheckstyleRssGenerator.java delete mode 100644 src/main/java/org/apache/maven/plugins/checkstyle/rss/VelocityTemplate.java delete mode 100644 src/main/resources/org/apache/maven/plugins/checkstyle/checkstyle-rss.vm delete mode 100644 src/main/resources/org/apache/maven/plugins/checkstyle/images/rss.png delete mode 100644 src/test/java/org/apache/maven/plugins/checkstyle/ReportResourceTest.java diff --git a/pom.xml b/pom.xml index a88db4f9..baf1e0fa 100644 --- a/pom.xml +++ b/pom.xml @@ -172,25 +172,6 @@ under the License. plexus-utils 3.5.1 - - org.codehaus.plexus - plexus-velocity - 1.2 - - - org.codehaus.plexus - plexus-container-default - - - org.codehaus.plexus - plexus-component-api - - - velocity - velocity - - - @@ -204,13 +185,6 @@ under the License. 3.12.0 - - - org.apache.velocity - velocity - 1.7 - - org.codehaus.plexus diff --git a/src/it/MCHECKSTYLE-357-with-header-override/pom.xml b/src/it/MCHECKSTYLE-357-with-header-override/pom.xml index 9a11d16f..b05481ee 100644 --- a/src/it/MCHECKSTYLE-357-with-header-override/pom.xml +++ b/src/it/MCHECKSTYLE-357-with-header-override/pom.xml @@ -187,9 +187,6 @@ maven-checkstyle-plugin - - true - diff --git a/src/it/MCHECKSTYLE-357-with-header-override/verify.groovy b/src/it/MCHECKSTYLE-357-with-header-override/verify.groovy index 946bc919..b7dc255d 100644 --- a/src/it/MCHECKSTYLE-357-with-header-override/verify.groovy +++ b/src/it/MCHECKSTYLE-357-with-header-override/verify.groovy @@ -24,7 +24,4 @@ assert new File(basedir, 'target/checkstyle-checker.xml').exists(); assert new File(basedir, 'target/checkstyle-result.xml').exists(); assert new File(basedir, 'target/checkstyle-rules.xml').exists(); -File rssFile = new File( basedir, 'target/site/checkstyle.rss' ); -assert rssFile.exists(); - return true; diff --git a/src/it/MCHECKSTYLE-357/pom.xml b/src/it/MCHECKSTYLE-357/pom.xml index 3e809bfc..907599c1 100644 --- a/src/it/MCHECKSTYLE-357/pom.xml +++ b/src/it/MCHECKSTYLE-357/pom.xml @@ -172,9 +172,6 @@ maven-checkstyle-plugin - - true - diff --git a/src/it/MCHECKSTYLE-357/verify.groovy b/src/it/MCHECKSTYLE-357/verify.groovy index 946bc919..b7dc255d 100644 --- a/src/it/MCHECKSTYLE-357/verify.groovy +++ b/src/it/MCHECKSTYLE-357/verify.groovy @@ -24,7 +24,4 @@ assert new File(basedir, 'target/checkstyle-checker.xml').exists(); assert new File(basedir, 'target/checkstyle-result.xml').exists(); assert new File(basedir, 'target/checkstyle-rules.xml').exists(); -File rssFile = new File( basedir, 'target/site/checkstyle.rss' ); -assert rssFile.exists(); - return true; diff --git a/src/it/checkstyle-goal/pom.xml b/src/it/checkstyle-goal/pom.xml index 373425c3..58b699c6 100644 --- a/src/it/checkstyle-goal/pom.xml +++ b/src/it/checkstyle-goal/pom.xml @@ -41,9 +41,6 @@ org.apache.maven.plugins maven-checkstyle-plugin @project.version@ - - true - diff --git a/src/it/checkstyle-goal/verify.groovy b/src/it/checkstyle-goal/verify.groovy index a5605efd..9cdc38c0 100644 --- a/src/it/checkstyle-goal/verify.groovy +++ b/src/it/checkstyle-goal/verify.groovy @@ -24,20 +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(); -File rssFile = new File( basedir, 'target/site/checkstyle.rss' ); -assert rssFile.exists(); - -def rss = new XmlParser().parse( rssFile ); - -def channel = rss.channel[0] - -assert channel.title.text() == 'check-pass - Checkstyle report' - -def item = channel.item[0] -assert item != null -assert item.title.text().startsWith('File: 1,') - def html = new File( basedir, 'target/site/checkstyle.html' ).text; assert html.contains( '' ); -return true; \ No newline at end of file +return true; diff --git a/src/it/checkstyle-report/pom.xml b/src/it/checkstyle-report/pom.xml index 9755cab7..19b87938 100644 --- a/src/it/checkstyle-report/pom.xml +++ b/src/it/checkstyle-report/pom.xml @@ -56,9 +56,6 @@ org.apache.maven.plugins maven-checkstyle-plugin @project.version@ - - true - diff --git a/src/it/checkstyle-report/verify.groovy b/src/it/checkstyle-report/verify.groovy index eda75a7a..7ff2754d 100644 --- a/src/it/checkstyle-report/verify.groovy +++ b/src/it/checkstyle-report/verify.groovy @@ -26,18 +26,4 @@ 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(); -File rssFile = new File( basedir, 'target/site/checkstyle.rss' ); -assert rssFile.exists(); - -def rss = new XmlParser().parse( rssFile ); - -def channel = rss.channel[0] - -assert channel.title.text() == 'check-pass - Checkstyle report' - -def item = channel.item[0] -assert item != null -assert item.title.text().startsWith('File: 1,') - - -return true; \ No newline at end of file +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 f0691d83..3f55bef1 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java @@ -25,7 +25,6 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; -import java.util.Calendar; import java.util.List; import java.util.Locale; import java.util.Map; @@ -51,8 +50,6 @@ 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.plugins.checkstyle.rss.CheckstyleRssGenerator; -import org.apache.maven.plugins.checkstyle.rss.CheckstyleRssGeneratorRequest; import org.apache.maven.reporting.AbstractMavenReport; import org.apache.maven.reporting.MavenReportException; import org.codehaus.plexus.configuration.PlexusConfiguration; @@ -67,8 +64,6 @@ * */ public abstract class AbstractCheckstyleReport extends AbstractMavenReport { - public static final String PLUGIN_RESOURCES = "org/apache/maven/plugins/checkstyle"; - protected static final String JAVA_FILES = "**\\/*.java"; private static final String DEFAULT_CONFIG_LOCATION = "sun_checks.xml"; @@ -342,15 +337,6 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport { @Parameter(property = "checkstyle.enable.files.summary", defaultValue = "true") private boolean enableFilesSummary; - /** - * Specifies if the RSS should be enabled or not. - * - * @deprecated This feature will be removed in a future version. - */ - @Parameter(property = "checkstyle.enable.rss", defaultValue = "false") - @Deprecated - private boolean enableRSS; - /** * The Plugin Descriptor */ @@ -446,15 +432,6 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport { @Component protected ResourceManager locator; - /** - * CheckstyleRssGenerator. - * - * @since 2.4 - */ - @Component(role = CheckstyleRssGenerator.class, hint = "default") - @Deprecated - protected CheckstyleRssGenerator checkstyleRssGenerator; - /** * @since 2.5 */ @@ -519,14 +496,7 @@ public void executeReport(Locale locale) throws MavenReportException { CheckstyleResults results = checkstyleExecutor.executeCheckstyle(request); ResourceBundle bundle = getBundle(locale); - generateReportStatics(); generateMainReport(results, bundle, effectiveConfigLocation); - if (enableRSS) { - CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest = - new CheckstyleRssGeneratorRequest(this.project, this.getCopyright(), outputDirectory, getLog()); - checkstyleRssGenerator.generateRSS(results, checkstyleRssGeneratorRequest); - } - } catch (CheckstyleException e) { throw new MavenReportException("Failed during checkstyle configuration", e); } catch (CheckstyleExecutorException e) { @@ -647,32 +617,6 @@ protected DefaultLogger getConsoleListener() throws MavenReportException { return consoleListener; } - private void generateReportStatics() throws MavenReportException { - ReportResource rresource = new ReportResource(PLUGIN_RESOURCES, outputDirectory); - try { - rresource.copy("images/rss.png"); - } catch (IOException e) { - throw new MavenReportException("Unable to copy static resources.", e); - } - } - - private String getCopyright() { - String copyright; - int currentYear = Calendar.getInstance().get(Calendar.YEAR); - if (StringUtils.isNotEmpty(project.getInceptionYear()) - && !String.valueOf(currentYear).equals(project.getInceptionYear())) { - copyright = project.getInceptionYear() + " - " + currentYear; - } else { - copyright = String.valueOf(currentYear); - } - - if ((project.getOrganization() != null) - && StringUtils.isNotEmpty(project.getOrganization().getName())) { - copyright = copyright + " " + project.getOrganization().getName(); - } - return copyright; - } - private void generateMainReport(CheckstyleResults results, ResourceBundle bundle, String configLocation) { CheckstyleReportGenerator generator = new CheckstyleReportGenerator(getSink(), bundle, project.getBasedir(), siteTool, configLocation); @@ -681,7 +625,6 @@ private void generateMainReport(CheckstyleResults results, ResourceBundle bundle generator.setEnableRulesSummary(enableRulesSummary); generator.setEnableSeveritySummary(enableSeveritySummary); generator.setEnableFilesSummary(enableFilesSummary); - generator.setEnableRSS(enableRSS); generator.setCheckstyleConfig(results.getConfiguration()); if (linkXRef) { initializeXrefLocation(generator); diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java index ce5553e7..cbc710d5 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java @@ -62,9 +62,6 @@ public class CheckstyleReportGenerator { private boolean enableFilesSummary; - @Deprecated - private boolean enableRSS; - private final SiteTool siteTool; private String xrefLocation; @@ -94,7 +91,6 @@ public CheckstyleReportGenerator( this.enableRulesSummary = true; this.enableSeveritySummary = true; this.enableFilesSummary = true; - this.enableRSS = false; this.iconTool = new IconTool(sink, bundle); } @@ -172,18 +168,6 @@ private void doHeading() { sink.text(String.format(bundle.getString("report.checkstyle.ruleset"), ruleset)); sink.text("."); - if (enableRSS) { - sink.nonBreakingSpace(); - sink.link("checkstyle.rss"); - sink.figure(); - sink.figureCaption(); - sink.text("rss feed"); - sink.figureCaption_(); - sink.figureGraphics("images/rss.png"); - sink.figure_(); - sink.link_(); - } - sink.paragraph_(); sink.section1_(); } @@ -689,16 +673,6 @@ public void setEnableFilesSummary(boolean enableFilesSummary) { this.enableFilesSummary = enableFilesSummary; } - @Deprecated - public boolean isEnableRSS() { - return enableRSS; - } - - @Deprecated - public void setEnableRSS(boolean enableRSS) { - this.enableRSS = enableRSS; - } - public String getXrefLocation() { return xrefLocation; } diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/ReportResource.java b/src/main/java/org/apache/maven/plugins/checkstyle/ReportResource.java deleted file mode 100644 index 557bbde0..00000000 --- a/src/main/java/org/apache/maven/plugins/checkstyle/ReportResource.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ -package org.apache.maven.plugins.checkstyle; - -import java.io.File; -import java.io.IOException; -import java.net.URL; - -import org.codehaus.plexus.util.FileUtils; - -/** - * Generic Report Resource management. - * - * @author Joakim Erdfelt - * - */ -public class ReportResource { - private String resourcePathBase; - - private File outputDirectory; - - public ReportResource(String resourcePathBase, File outputDirectory) { - this.resourcePathBase = resourcePathBase; - this.outputDirectory = outputDirectory; - } - - public void copy(String resourceName) throws IOException { - File resource = new File(outputDirectory, resourceName); - if (!resource.exists()) { - URL url = Thread.currentThread().getContextClassLoader().getResource(resourcePathBase + "/" + resourceName); - FileUtils.copyURLToFile(url, resource); - } - } - - public File getOutputDirectory() { - return outputDirectory; - } - - public void setOutputDirectory(File outputDirectory) { - this.outputDirectory = outputDirectory; - } - - public String getResourcePathBase() { - return resourcePathBase; - } - - public void setResourcePathBase(String resourcePathBase) { - this.resourcePathBase = resourcePathBase; - } -} diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGenerator.java b/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGenerator.java deleted file mode 100644 index 125a67a5..00000000 --- a/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGenerator.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ -package org.apache.maven.plugins.checkstyle.rss; - -import org.apache.maven.plugins.checkstyle.exec.CheckstyleResults; -import org.apache.maven.reporting.MavenReportException; - -/** - * @author Olivier Lamy - * @since 2.4 - */ -@Deprecated -public interface CheckstyleRssGenerator { - void generateRSS(CheckstyleResults results, CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest) - throws MavenReportException; -} diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGeneratorRequest.java b/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGeneratorRequest.java deleted file mode 100644 index c95c3c29..00000000 --- a/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGeneratorRequest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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. - */ -package org.apache.maven.plugins.checkstyle.rss; - -import java.io.File; - -import org.apache.maven.plugin.logging.Log; -import org.apache.maven.project.MavenProject; - -/** - * @author Olivier Lamy - * @since 2.4 - */ -@Deprecated -public class CheckstyleRssGeneratorRequest { - private MavenProject mavenProject; - - private String copyright; - - private File outputDirectory; - - private Log log; - - public CheckstyleRssGeneratorRequest(MavenProject mavenProject, String copyright, File outputDirectory, Log log) { - this.mavenProject = mavenProject; - this.copyright = copyright; - this.outputDirectory = outputDirectory; - this.log = log; - } - - public MavenProject getMavenProject() { - return mavenProject; - } - - public void setMavenProject(MavenProject mavenProject) { - this.mavenProject = mavenProject; - } - - public String getCopyright() { - return copyright; - } - - public void setCopyright(String copyright) { - this.copyright = copyright; - } - - public File getOutputDirectory() { - return outputDirectory; - } - - public void setOutputDirectory(File outputDirectory) { - this.outputDirectory = outputDirectory; - } - - public Log getLog() { - return log; - } - - public void setLog(Log log) { - this.log = log; - } -} diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/rss/DefaultCheckstyleRssGenerator.java b/src/main/java/org/apache/maven/plugins/checkstyle/rss/DefaultCheckstyleRssGenerator.java deleted file mode 100644 index a5622839..00000000 --- a/src/main/java/org/apache/maven/plugins/checkstyle/rss/DefaultCheckstyleRssGenerator.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ -package org.apache.maven.plugins.checkstyle.rss; - -import java.io.IOException; - -import com.puppycrawl.tools.checkstyle.api.SeverityLevel; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.checkstyle.CheckstyleReport; -import org.apache.maven.plugins.checkstyle.exec.CheckstyleResults; -import org.apache.maven.reporting.MavenReportException; -import org.apache.velocity.VelocityContext; -import org.apache.velocity.context.Context; -import org.apache.velocity.exception.ResourceNotFoundException; -import org.apache.velocity.exception.VelocityException; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.util.StringUtils; -import org.codehaus.plexus.velocity.VelocityComponent; - -/** - * @author Olivier Lamy - * @since 2.4 - */ -@Component(role = CheckstyleRssGenerator.class, hint = "default") -@Deprecated -public class DefaultCheckstyleRssGenerator implements CheckstyleRssGenerator { - @Requirement - private VelocityComponent velocityComponent; - - @Override - public void generateRSS(CheckstyleResults results, CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest) - throws MavenReportException { - - VelocityTemplate vtemplate = new VelocityTemplate(velocityComponent, CheckstyleReport.PLUGIN_RESOURCES); - vtemplate.setLog(checkstyleRssGeneratorRequest.getLog()); - - Context context = new VelocityContext(); - context.put("results", results); - context.put("project", checkstyleRssGeneratorRequest.getMavenProject()); - context.put("copyright", checkstyleRssGeneratorRequest.getCopyright()); - context.put("levelInfo", SeverityLevel.INFO); - context.put("levelWarning", SeverityLevel.WARNING); - context.put("levelError", SeverityLevel.ERROR); - context.put("stringutils", new StringUtils()); - - try { - vtemplate.generate( - checkstyleRssGeneratorRequest.getOutputDirectory().getPath() + "/checkstyle.rss", - "checkstyle-rss.vm", - context); - } catch (ResourceNotFoundException e) { - throw new MavenReportException("Unable to find checkstyle-rss.vm resource.", e); - } catch (MojoExecutionException | IOException | VelocityException e) { - throw new MavenReportException("Unable to generate checkstyle.rss.", e); - } - } -} diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/rss/VelocityTemplate.java b/src/main/java/org/apache/maven/plugins/checkstyle/rss/VelocityTemplate.java deleted file mode 100644 index 758728ba..00000000 --- a/src/main/java/org/apache/maven/plugins/checkstyle/rss/VelocityTemplate.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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. - */ -package org.apache.maven.plugins.checkstyle.rss; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.nio.charset.StandardCharsets; - -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.logging.Log; -import org.apache.maven.plugin.logging.SystemStreamLog; -import org.apache.velocity.context.Context; -import org.apache.velocity.exception.ResourceNotFoundException; -import org.apache.velocity.exception.VelocityException; -import org.codehaus.plexus.velocity.VelocityComponent; - -/** - *

- * A component to work with Velocity templates from within plugins. - *

- * You will need to reference the velocity component as a parameter - * in your plugin. Like this: - *

- * /**
- *  * Velocity Component
- *  * @component
- *  */
- *  private VelocityComponent velocity;
- * 
- * - * @author Joakim Erdfelt - * - */ -@Deprecated -public class VelocityTemplate { - private String templateDirectory; - - private Log log; - - private VelocityComponent velocity; - - public VelocityTemplate(VelocityComponent velocityComponent, String templateBaseDirectory) { - this.velocity = velocityComponent; - this.templateDirectory = templateBaseDirectory; - } - - public String getTemplateDirectory() { - return templateDirectory; - } - - public VelocityComponent getVelocity() { - return velocity; - } - - /** - * Using a specified Velocity Template and provided context, create the outputFilename. - * - * @param outputFilename the file to be generated. - * @param template the velocity template to use - * @param context the velocity context map - * @throws VelocityException if the template was not found or any other Velocity exception - * @throws MojoExecutionException if merging the velocity template failed - * @throws IOException if there was an error writing to the output file - */ - public void generate(String outputFilename, String template, Context context) - throws VelocityException, MojoExecutionException, IOException { - - File outputFile = new File(outputFilename); - if (!outputFile.getParentFile().exists()) { - outputFile.getParentFile().mkdirs(); - } - - try (Writer writer = new OutputStreamWriter(new FileOutputStream(outputFile), StandardCharsets.UTF_8)) { - getVelocity().getEngine().mergeTemplate(templateDirectory + "/" + template, context, writer); - } catch (ResourceNotFoundException e) { - throw new ResourceNotFoundException("Template not found: " + templateDirectory + "/" + template, e); - } catch (RuntimeException e) { - throw new MojoExecutionException(e.getMessage(), e); - } - } - - public void setTemplateDirectory(String templateDirectory) { - this.templateDirectory = templateDirectory; - } - - public void setVelocity(VelocityComponent velocity) { - this.velocity = velocity; - } - - public Log getLog() { - if (this.log == null) { - this.log = new SystemStreamLog(); - } - return log; - } - - public void setLog(Log log) { - this.log = log; - } -} diff --git a/src/main/resources/org/apache/maven/plugins/checkstyle/checkstyle-rss.vm b/src/main/resources/org/apache/maven/plugins/checkstyle/checkstyle-rss.vm deleted file mode 100644 index 77c908d7..00000000 --- a/src/main/resources/org/apache/maven/plugins/checkstyle/checkstyle-rss.vm +++ /dev/null @@ -1,74 +0,0 @@ - - - - - ${project.name} - Checkstyle report - ${project.url} - ${project.name} - Checkstyle report - en-us - ©${copyright} - - File: $results.getFileCount(), - Errors: $results.getSeverityCount($levelError), - Warnings: $results.getSeverityCount($levelWarning), - Infos: $results.getSeverityCount($levelInfo) - - #set ( $reportlink = "${project.url}/checkstyle.html" ) - $reportlink - -

Click here for the full Checkstyle report.

- - - - - - - - - - - - #foreach( $key in $results.files.keySet() ) - #set ( $filename = $key.toString() ) - #set ( $anchor = $stringutils.replace( $filename, '\\', '/' ) ) - #set ( $anchor = $stringutils.replace( $anchor, '/', '.' ) ) - - - - - - - #end - -
FilesIWE
- $filename - - $results.getSeverityCount(${key}, $levelInfo) - - $results.getSeverityCount(${key}, $levelWarning) - - $results.getSeverityCount(${key}, $levelError) -
- -
-
-
-
- diff --git a/src/main/resources/org/apache/maven/plugins/checkstyle/images/rss.png b/src/main/resources/org/apache/maven/plugins/checkstyle/images/rss.png deleted file mode 100644 index f0796ac886201eb43b7a15113e2deb1b32fa9a09..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360 zcmV-u0hj)XP)1pTfh($;sL0vc}u{{{FPIw4gub**+Xunj;hMg-Rk@N{o&!^ z{r&#_{{B{et%#+@{r~@)vdh1}zle=^0GR*(m;g35HkdZcHkixXHq)$8FWQhbW?9;ba!ELWdKKV zVQ^?^V?%Flc4cyOWpXuLNbUdt06|GaK~#90Vz9#p80;8u1CXpOE?Whx%fLW2AK{k88_xIu00030{{sMfLr(Xb|5zme0000true true true - true **/*.java google_checks.xml LICENSE.txt 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 e9aa739a..7d1c8cb0 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 @@ -28,7 +28,6 @@ under the License. true true true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt diff --git a/src/test/resources/plugin-configs/fail-on-error-plugin-config.xml b/src/test/resources/plugin-configs/fail-on-error-plugin-config.xml index 4090e096..a3bae690 100644 --- a/src/test/resources/plugin-configs/fail-on-error-plugin-config.xml +++ b/src/test/resources/plugin-configs/fail-on-error-plugin-config.xml @@ -27,7 +27,6 @@ under the License. true true true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt diff --git a/src/test/resources/plugin-configs/min-plugin-config.xml b/src/test/resources/plugin-configs/min-plugin-config.xml index 5ce4ca1a..1cb1e8e9 100644 --- a/src/test/resources/plugin-configs/min-plugin-config.xml +++ b/src/test/resources/plugin-configs/min-plugin-config.xml @@ -32,7 +32,6 @@ under the License. true true true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt diff --git a/src/test/resources/plugin-configs/multi-plugin-config.xml b/src/test/resources/plugin-configs/multi-plugin-config.xml index 9bb0c059..e1b9d9c0 100644 --- a/src/test/resources/plugin-configs/multi-plugin-config.xml +++ b/src/test/resources/plugin-configs/multi-plugin-config.xml @@ -27,7 +27,6 @@ under the License. true true true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt 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 ce32b86f..49061c73 100644 --- a/src/test/resources/plugin-configs/no-files-plugin-config.xml +++ b/src/test/resources/plugin-configs/no-files-plugin-config.xml @@ -32,7 +32,6 @@ under the License. true true false - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt 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 899bc84d..a3795edd 100644 --- a/src/test/resources/plugin-configs/no-rules-plugin-config.xml +++ b/src/test/resources/plugin-configs/no-rules-plugin-config.xml @@ -32,7 +32,6 @@ under the License. false true true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt 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 416c9fc1..fb785b11 100644 --- a/src/test/resources/plugin-configs/no-severity-plugin-config.xml +++ b/src/test/resources/plugin-configs/no-severity-plugin-config.xml @@ -32,7 +32,6 @@ under the License. true false true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt diff --git a/src/test/resources/plugin-configs/no-source-plugin-config.xml b/src/test/resources/plugin-configs/no-source-plugin-config.xml index fab72514..0ca6522e 100644 --- a/src/test/resources/plugin-configs/no-source-plugin-config.xml +++ b/src/test/resources/plugin-configs/no-source-plugin-config.xml @@ -31,7 +31,6 @@ under the License. true true true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt 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 4678fa4e..9ca9d037 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 @@ -32,7 +32,6 @@ under the License. true true true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt diff --git a/src/test/resources/plugin-configs/useFile-plugin-config.xml b/src/test/resources/plugin-configs/useFile-plugin-config.xml index 89e78b4d..f78464d3 100644 --- a/src/test/resources/plugin-configs/useFile-plugin-config.xml +++ b/src/test/resources/plugin-configs/useFile-plugin-config.xml @@ -32,7 +32,6 @@ under the License. true true true - true **/*.java sun_checks.xml ${basedir}/src/test/test-sources/LICENSE.txt