Skip to content

Commit b08abc2

Browse files
committed
[MCHECKSTYLE-435] Remove deprecated RSS feature
This closes #117
1 parent 71bc1ff commit b08abc2

31 files changed

+2
-671
lines changed

pom.xml

-26
Original file line numberDiff line numberDiff line change
@@ -172,25 +172,6 @@ under the License.
172172
<artifactId>plexus-utils</artifactId>
173173
<version>3.5.1</version>
174174
</dependency>
175-
<dependency>
176-
<groupId>org.codehaus.plexus</groupId>
177-
<artifactId>plexus-velocity</artifactId>
178-
<version>1.2</version>
179-
<exclusions>
180-
<exclusion>
181-
<groupId>org.codehaus.plexus</groupId>
182-
<artifactId>plexus-container-default</artifactId>
183-
</exclusion>
184-
<exclusion>
185-
<groupId>org.codehaus.plexus</groupId>
186-
<artifactId>plexus-component-api</artifactId>
187-
</exclusion>
188-
<exclusion>
189-
<groupId>velocity</groupId>
190-
<artifactId>velocity</artifactId>
191-
</exclusion>
192-
</exclusions>
193-
</dependency>
194175

195176
<!-- checkstyle -->
196177
<dependency>
@@ -204,13 +185,6 @@ under the License.
204185
<version>3.12.0</version>
205186
</dependency>
206187

207-
<!-- misc -->
208-
<dependency>
209-
<groupId>org.apache.velocity</groupId>
210-
<artifactId>velocity</artifactId>
211-
<version>1.7</version>
212-
</dependency>
213-
214188
<!-- test -->
215189
<dependency>
216190
<groupId>org.codehaus.plexus</groupId>

src/it/MCHECKSTYLE-357-with-header-override/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@
187187
<plugins>
188188
<plugin>
189189
<artifactId>maven-checkstyle-plugin</artifactId>
190-
<configuration>
191-
<enableRSS>true</enableRSS>
192-
</configuration>
193190
<reportSets>
194191
<reportSet>
195192
<reports>

src/it/MCHECKSTYLE-357-with-header-override/verify.groovy

-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,4 @@ assert new File(basedir, 'target/checkstyle-checker.xml').exists();
2424
assert new File(basedir, 'target/checkstyle-result.xml').exists();
2525
assert new File(basedir, 'target/checkstyle-rules.xml').exists();
2626

27-
File rssFile = new File( basedir, 'target/site/checkstyle.rss' );
28-
assert rssFile.exists();
29-
3027
return true;

src/it/MCHECKSTYLE-357/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@
172172
<plugins>
173173
<plugin>
174174
<artifactId>maven-checkstyle-plugin</artifactId>
175-
<configuration>
176-
<enableRSS>true</enableRSS>
177-
</configuration>
178175
<reportSets>
179176
<reportSet>
180177
<reports>

src/it/MCHECKSTYLE-357/verify.groovy

-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,4 @@ assert new File(basedir, 'target/checkstyle-checker.xml').exists();
2424
assert new File(basedir, 'target/checkstyle-result.xml').exists();
2525
assert new File(basedir, 'target/checkstyle-rules.xml').exists();
2626

27-
File rssFile = new File( basedir, 'target/site/checkstyle.rss' );
28-
assert rssFile.exists();
29-
3027
return true;

src/it/checkstyle-goal/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
<groupId>org.apache.maven.plugins</groupId>
4242
<artifactId>maven-checkstyle-plugin</artifactId>
4343
<version>@project.version@</version>
44-
<configuration>
45-
<enableRSS>true</enableRSS>
46-
</configuration>
4744
</plugin>
4845
</plugins>
4946
</build>

src/it/checkstyle-goal/verify.groovy

+1-14
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,7 @@ assert new File( basedir, 'target/checkstyle-checker.xml' ).exists();
2424
assert new File( basedir, 'target/checkstyle-header.txt' ).exists();
2525
assert new File( basedir, 'target/checkstyle-result.xml' ).exists();
2626

27-
File rssFile = new File( basedir, 'target/site/checkstyle.rss' );
28-
assert rssFile.exists();
29-
30-
def rss = new XmlParser().parse( rssFile );
31-
32-
def channel = rss.channel[0]
33-
34-
assert channel.title.text() == 'check-pass - Checkstyle report'
35-
36-
def item = channel.item[0]
37-
assert item != null
38-
assert item.title.text().startsWith('File: 1,')
39-
4027
def html = new File( basedir, 'target/site/checkstyle.html' ).text;
4128
assert html.contains( '<meta charset="UTF-8" />' );
4229

43-
return true;
30+
return true;

src/it/checkstyle-report/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-checkstyle-plugin</artifactId>
5858
<version>@project.version@</version>
59-
<configuration>
60-
<enableRSS>true</enableRSS>
61-
</configuration>
6259
<reportSets>
6360
<reportSet>
6461
<reports>

src/it/checkstyle-report/verify.groovy

+1-15
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,4 @@ assert new File(basedir, 'target/checkstyle-checker.xml').exists();
2626
assert new File(basedir, 'target/checkstyle-header.txt').exists();
2727
assert new File(basedir, 'target/checkstyle-result.xml').exists();
2828

29-
File rssFile = new File( basedir, 'target/site/checkstyle.rss' );
30-
assert rssFile.exists();
31-
32-
def rss = new XmlParser().parse( rssFile );
33-
34-
def channel = rss.channel[0]
35-
36-
assert channel.title.text() == 'check-pass - Checkstyle report'
37-
38-
def item = channel.item[0]
39-
assert item != null
40-
assert item.title.text().startsWith('File: 1,')
41-
42-
43-
return true;
29+
return true;

src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java

-57
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.io.IOException;
2626
import java.io.OutputStream;
2727
import java.util.ArrayList;
28-
import java.util.Calendar;
2928
import java.util.List;
3029
import java.util.Locale;
3130
import java.util.Map;
@@ -51,8 +50,6 @@
5150
import org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorException;
5251
import org.apache.maven.plugins.checkstyle.exec.CheckstyleExecutorRequest;
5352
import org.apache.maven.plugins.checkstyle.exec.CheckstyleResults;
54-
import org.apache.maven.plugins.checkstyle.rss.CheckstyleRssGenerator;
55-
import org.apache.maven.plugins.checkstyle.rss.CheckstyleRssGeneratorRequest;
5653
import org.apache.maven.reporting.AbstractMavenReport;
5754
import org.apache.maven.reporting.MavenReportException;
5855
import org.codehaus.plexus.configuration.PlexusConfiguration;
@@ -67,8 +64,6 @@
6764
*
6865
*/
6966
public abstract class AbstractCheckstyleReport extends AbstractMavenReport {
70-
public static final String PLUGIN_RESOURCES = "org/apache/maven/plugins/checkstyle";
71-
7267
protected static final String JAVA_FILES = "**\\/*.java";
7368

7469
private static final String DEFAULT_CONFIG_LOCATION = "sun_checks.xml";
@@ -342,15 +337,6 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport {
342337
@Parameter(property = "checkstyle.enable.files.summary", defaultValue = "true")
343338
private boolean enableFilesSummary;
344339

345-
/**
346-
* Specifies if the RSS should be enabled or not.
347-
*
348-
* @deprecated This feature will be removed in a future version.
349-
*/
350-
@Parameter(property = "checkstyle.enable.rss", defaultValue = "false")
351-
@Deprecated
352-
private boolean enableRSS;
353-
354340
/**
355341
* The Plugin Descriptor
356342
*/
@@ -446,15 +432,6 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport {
446432
@Component
447433
protected ResourceManager locator;
448434

449-
/**
450-
* CheckstyleRssGenerator.
451-
*
452-
* @since 2.4
453-
*/
454-
@Component(role = CheckstyleRssGenerator.class, hint = "default")
455-
@Deprecated
456-
protected CheckstyleRssGenerator checkstyleRssGenerator;
457-
458435
/**
459436
* @since 2.5
460437
*/
@@ -519,14 +496,7 @@ public void executeReport(Locale locale) throws MavenReportException {
519496
CheckstyleResults results = checkstyleExecutor.executeCheckstyle(request);
520497

521498
ResourceBundle bundle = getBundle(locale);
522-
generateReportStatics();
523499
generateMainReport(results, bundle, effectiveConfigLocation);
524-
if (enableRSS) {
525-
CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest =
526-
new CheckstyleRssGeneratorRequest(this.project, this.getCopyright(), outputDirectory, getLog());
527-
checkstyleRssGenerator.generateRSS(results, checkstyleRssGeneratorRequest);
528-
}
529-
530500
} catch (CheckstyleException e) {
531501
throw new MavenReportException("Failed during checkstyle configuration", e);
532502
} catch (CheckstyleExecutorException e) {
@@ -647,32 +617,6 @@ protected DefaultLogger getConsoleListener() throws MavenReportException {
647617
return consoleListener;
648618
}
649619

650-
private void generateReportStatics() throws MavenReportException {
651-
ReportResource rresource = new ReportResource(PLUGIN_RESOURCES, outputDirectory);
652-
try {
653-
rresource.copy("images/rss.png");
654-
} catch (IOException e) {
655-
throw new MavenReportException("Unable to copy static resources.", e);
656-
}
657-
}
658-
659-
private String getCopyright() {
660-
String copyright;
661-
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
662-
if (StringUtils.isNotEmpty(project.getInceptionYear())
663-
&& !String.valueOf(currentYear).equals(project.getInceptionYear())) {
664-
copyright = project.getInceptionYear() + " - " + currentYear;
665-
} else {
666-
copyright = String.valueOf(currentYear);
667-
}
668-
669-
if ((project.getOrganization() != null)
670-
&& StringUtils.isNotEmpty(project.getOrganization().getName())) {
671-
copyright = copyright + " " + project.getOrganization().getName();
672-
}
673-
return copyright;
674-
}
675-
676620
private void generateMainReport(CheckstyleResults results, ResourceBundle bundle, String configLocation) {
677621
CheckstyleReportGenerator generator =
678622
new CheckstyleReportGenerator(getSink(), bundle, project.getBasedir(), siteTool, configLocation);
@@ -681,7 +625,6 @@ private void generateMainReport(CheckstyleResults results, ResourceBundle bundle
681625
generator.setEnableRulesSummary(enableRulesSummary);
682626
generator.setEnableSeveritySummary(enableSeveritySummary);
683627
generator.setEnableFilesSummary(enableFilesSummary);
684-
generator.setEnableRSS(enableRSS);
685628
generator.setCheckstyleConfig(results.getConfiguration());
686629
if (linkXRef) {
687630
initializeXrefLocation(generator);

src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java

-26
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ public class CheckstyleReportGenerator {
6262

6363
private boolean enableFilesSummary;
6464

65-
@Deprecated
66-
private boolean enableRSS;
67-
6865
private final SiteTool siteTool;
6966

7067
private String xrefLocation;
@@ -94,7 +91,6 @@ public CheckstyleReportGenerator(
9491
this.enableRulesSummary = true;
9592
this.enableSeveritySummary = true;
9693
this.enableFilesSummary = true;
97-
this.enableRSS = false;
9894
this.iconTool = new IconTool(sink, bundle);
9995
}
10096

@@ -172,18 +168,6 @@ private void doHeading() {
172168
sink.text(String.format(bundle.getString("report.checkstyle.ruleset"), ruleset));
173169
sink.text(".");
174170

175-
if (enableRSS) {
176-
sink.nonBreakingSpace();
177-
sink.link("checkstyle.rss");
178-
sink.figure();
179-
sink.figureCaption();
180-
sink.text("rss feed");
181-
sink.figureCaption_();
182-
sink.figureGraphics("images/rss.png");
183-
sink.figure_();
184-
sink.link_();
185-
}
186-
187171
sink.paragraph_();
188172
sink.section1_();
189173
}
@@ -689,16 +673,6 @@ public void setEnableFilesSummary(boolean enableFilesSummary) {
689673
this.enableFilesSummary = enableFilesSummary;
690674
}
691675

692-
@Deprecated
693-
public boolean isEnableRSS() {
694-
return enableRSS;
695-
}
696-
697-
@Deprecated
698-
public void setEnableRSS(boolean enableRSS) {
699-
this.enableRSS = enableRSS;
700-
}
701-
702676
public String getXrefLocation() {
703677
return xrefLocation;
704678
}

src/main/java/org/apache/maven/plugins/checkstyle/ReportResource.java

-66
This file was deleted.

0 commit comments

Comments
 (0)