Skip to content

Commit cbf3751

Browse files
committed
[MCHECKSTYLE-418] Deprecate RSS feature and disable by default
1 parent 549bf3d commit cbf3751

File tree

10 files changed

+38
-15
lines changed

10 files changed

+38
-15
lines changed

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

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

src/it/MCHECKSTYLE-357/pom.xml

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

src/it/checkstyle-goal/pom.xml

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

src/it/checkstyle-report/pom.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<groupId>org.apache.maven.plugins</groupId>
4747
<artifactId>maven-site-plugin</artifactId>
4848
<version>@sitePluginVersion@</version>
49-
</plugin>
49+
</plugin>
5050
</plugins>
5151
</build>
5252
<reporting>
@@ -56,6 +56,9 @@
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-checkstyle-plugin</artifactId>
5858
<version>@pom.version@</version>
59+
<configuration>
60+
<enableRSS>true</enableRSS>
61+
</configuration>
5962
<reportSets>
6063
<reportSet>
6164
<reports>

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

+11-7
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public abstract class AbstractCheckstyleReport
251251

252252
/**
253253
* Specifies the location of the source directory to be used for Checkstyle.
254-
*
254+
*
255255
* @deprecated instead use {@link #sourceDirectories}. For version 3.0.0, this parameter is only defined to break
256256
* the build if you use it!
257257
*/
@@ -267,7 +267,7 @@ public abstract class AbstractCheckstyleReport
267267
// Compatibility with all Maven 3: default of 'project.compileSourceRoots' is done manually because of MNG-5440
268268
@Parameter
269269
private List<String> sourceDirectories;
270-
270+
271271
/**
272272
* Specifies the location of the test source directory to be used for Checkstyle.
273273
*
@@ -278,7 +278,7 @@ public abstract class AbstractCheckstyleReport
278278
@Parameter
279279
@Deprecated
280280
private File testSourceDirectory;
281-
281+
282282
/**
283283
* Specifies the location of the test source directories to be used for Checkstyle.
284284
* Default value is <code>${project.testCompileSourceRoots}</code>.
@@ -355,8 +355,11 @@ public abstract class AbstractCheckstyleReport
355355

356356
/**
357357
* Specifies if the RSS should be enabled or not.
358+
*
359+
* @deprecated This feature will be removed in a future version.
358360
*/
359-
@Parameter( property = "checkstyle.enable.rss", defaultValue = "true" )
361+
@Parameter( property = "checkstyle.enable.rss", defaultValue = "false" )
362+
@Deprecated
360363
private boolean enableRSS;
361364

362365
/**
@@ -397,7 +400,7 @@ public abstract class AbstractCheckstyleReport
397400
/**
398401
* When using custom treeWalkers, specify their names here so the checks
399402
* inside the treeWalker end up the the rule-summary.
400-
*
403+
*
401404
* @since 2.11
402405
*/
403406
@Parameter
@@ -406,7 +409,7 @@ public abstract class AbstractCheckstyleReport
406409
/**
407410
* Specifies whether modules with a configured severity of <code>ignore</code> should be omitted during Checkstyle
408411
* invocation.
409-
*
412+
*
410413
* @since 3.0.0
411414
*/
412415
@Parameter( defaultValue = "false" )
@@ -466,6 +469,7 @@ public abstract class AbstractCheckstyleReport
466469
* @since 2.4
467470
*/
468471
@Component( role = CheckstyleRssGenerator.class, hint = "default" )
472+
@Deprecated
469473
protected CheckstyleRssGenerator checkstyleRssGenerator;
470474

471475
/**
@@ -602,7 +606,7 @@ private List<Artifact> collectArtifacts( String hint )
602606
private List<Artifact> getCheckstylePluginDependenciesAsArtifacts( Map<String, Plugin> plugins, String hint )
603607
{
604608
List<Artifact> artifacts = new ArrayList<>();
605-
609+
606610
Plugin checkstylePlugin = plugins.get( plugin.getGroupId() + ":" + plugin.getArtifactId() );
607611
if ( checkstylePlugin != null )
608612
{

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public class CheckstyleReportGenerator
6565

6666
private boolean enableFilesSummary;
6767

68+
@Deprecated
6869
private boolean enableRSS;
6970

7071
private final SiteTool siteTool;
@@ -97,7 +98,7 @@ public CheckstyleReportGenerator( Sink sink, ResourceBundle bundle, File basedir
9798
this.enableRulesSummary = true;
9899
this.enableSeveritySummary = true;
99100
this.enableFilesSummary = true;
100-
this.enableRSS = true;
101+
this.enableRSS = false;
101102
this.iconTool = new IconTool( sink, bundle );
102103
}
103104

@@ -717,7 +718,7 @@ private boolean isTestSource( final String absoluteFilename )
717718
return true;
718719
}
719720
}
720-
721+
721722
return false;
722723
}
723724

@@ -761,11 +762,13 @@ public void setEnableFilesSummary( boolean enableFilesSummary )
761762
this.enableFilesSummary = enableFilesSummary;
762763
}
763764

765+
@Deprecated
764766
public boolean isEnableRSS()
765767
{
766768
return enableRSS;
767769
}
768770

771+
@Deprecated
769772
public void setEnableRSS( boolean enableRSS )
770773
{
771774
this.enableRSS = enableRSS;
@@ -791,12 +794,12 @@ public void setXrefTestLocation( String xrefTestLocation )
791794
this.xrefTestLocation = xrefTestLocation;
792795
}
793796

794-
public List<File> getTestSourceDirectories()
797+
public List<File> getTestSourceDirectories()
795798
{
796799
return testSourceDirectories;
797800
}
798801

799-
public void setTestSourceDirectories( List<File> testSourceDirectories )
802+
public void setTestSourceDirectories( List<File> testSourceDirectories )
800803
{
801804
this.testSourceDirectories = testSourceDirectories;
802805
}

src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGenerator.java

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* @author Olivier Lamy
2727
* @since 2.4
2828
*/
29+
@Deprecated
2930
public interface CheckstyleRssGenerator
3031
{
3132
void generateRSS( CheckstyleResults results, CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest )

src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGeneratorRequest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@
2828
* @author Olivier Lamy
2929
* @since 2.4
3030
*/
31+
@Deprecated
3132
public class CheckstyleRssGeneratorRequest
3233
{
3334
private MavenProject mavenProject;
3435

3536
private String copyright;
3637

3738
private File outputDirectory;
38-
39+
3940
private Log log;
4041

4142
public CheckstyleRssGeneratorRequest( MavenProject mavenProject, String copyright, File outputDirectory, Log log )

src/main/java/org/apache/maven/plugins/checkstyle/rss/DefaultCheckstyleRssGenerator.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* @since 2.4
4242
*/
4343
@Component( role = CheckstyleRssGenerator.class, hint = "default" )
44+
@Deprecated
4445
public class DefaultCheckstyleRssGenerator
4546
implements CheckstyleRssGenerator
4647
{
@@ -78,5 +79,5 @@ public void generateRSS( CheckstyleResults results, CheckstyleRssGeneratorReques
7879
throw new MavenReportException( "Unable to generate checkstyle.rss.", e );
7980
}
8081
}
81-
82+
8283
}

src/main/java/org/apache/maven/plugins/checkstyle/rss/VelocityTemplate.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
* @author <a href="mailto:[email protected]">Joakim Erdfelt</a>
5252
*
5353
*/
54+
@Deprecated
5455
public class VelocityTemplate
5556
{
5657
private String templateDirectory;
@@ -94,7 +95,7 @@ public void generate( String outputFilename, String template, Context context )
9495
{
9596
outputFile.getParentFile().mkdirs();
9697
}
97-
98+
9899
try ( Writer writer = new OutputStreamWriter( new FileOutputStream( outputFile ), StandardCharsets.UTF_8 ) )
99100
{
100101
getVelocity().getEngine().mergeTemplate( templateDirectory + "/" + template, context, writer );

0 commit comments

Comments
 (0)