You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/08/18 20:08:20 UTC

[maven-checkstyle-plugin] 01/01: [MCHECKSTYLE-418] Deprecate RSS feature and disable by default

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MCHECKSTYLE-418
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git

commit cbf3751a152d542715cf2b2219ab1de0850b2730
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Thu Aug 18 22:04:27 2022 +0200

    [MCHECKSTYLE-418] Deprecate RSS feature and disable by default
---
 src/it/MCHECKSTYLE-357-with-header-override/pom.xml    |  3 +++
 src/it/MCHECKSTYLE-357/pom.xml                         |  3 +++
 src/it/checkstyle-goal/pom.xml                         |  3 +++
 src/it/checkstyle-report/pom.xml                       |  5 ++++-
 .../plugins/checkstyle/AbstractCheckstyleReport.java   | 18 +++++++++++-------
 .../plugins/checkstyle/CheckstyleReportGenerator.java  | 11 +++++++----
 .../plugins/checkstyle/rss/CheckstyleRssGenerator.java |  1 +
 .../checkstyle/rss/CheckstyleRssGeneratorRequest.java  |  3 ++-
 .../checkstyle/rss/DefaultCheckstyleRssGenerator.java  |  3 ++-
 .../maven/plugins/checkstyle/rss/VelocityTemplate.java |  3 ++-
 10 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/src/it/MCHECKSTYLE-357-with-header-override/pom.xml b/src/it/MCHECKSTYLE-357-with-header-override/pom.xml
index e38034e..6a0d990 100644
--- a/src/it/MCHECKSTYLE-357-with-header-override/pom.xml
+++ b/src/it/MCHECKSTYLE-357-with-header-override/pom.xml
@@ -187,6 +187,9 @@
         <plugins>
             <plugin>
                 <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <enableRSS>true</enableRSS>
+                </configuration>
                 <reportSets>
                      <reportSet>
                          <reports>
diff --git a/src/it/MCHECKSTYLE-357/pom.xml b/src/it/MCHECKSTYLE-357/pom.xml
index dfbdb97..4ac7dc9 100644
--- a/src/it/MCHECKSTYLE-357/pom.xml
+++ b/src/it/MCHECKSTYLE-357/pom.xml
@@ -172,6 +172,9 @@
         <plugins>
             <plugin>
                 <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <enableRSS>true</enableRSS>
+                </configuration>
                 <reportSets>
                      <reportSet>
                          <reports>
diff --git a/src/it/checkstyle-goal/pom.xml b/src/it/checkstyle-goal/pom.xml
index 20ac9fd..821dcb2 100644
--- a/src/it/checkstyle-goal/pom.xml
+++ b/src/it/checkstyle-goal/pom.xml
@@ -41,6 +41,9 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <version>@pom.version@</version>
+        <configuration>
+          <enableRSS>true</enableRSS>
+        </configuration>
       </plugin>
     </plugins>
   </build>
diff --git a/src/it/checkstyle-report/pom.xml b/src/it/checkstyle-report/pom.xml
index 04e45b7..686c43c 100644
--- a/src/it/checkstyle-report/pom.xml
+++ b/src/it/checkstyle-report/pom.xml
@@ -46,7 +46,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-site-plugin</artifactId>
         <version>@sitePluginVersion@</version>
-      </plugin>      
+      </plugin>
     </plugins>
   </build>
   <reporting>
@@ -56,6 +56,9 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
         <version>@pom.version@</version>
+        <configuration>
+          <enableRSS>true</enableRSS>
+        </configuration>
         <reportSets>
           <reportSet>
             <reports>
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 f6df100..583c5f3 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
@@ -251,7 +251,7 @@ public abstract class AbstractCheckstyleReport
 
     /**
      * Specifies the location of the source directory to be used for Checkstyle.
-     * 
+     *
      * @deprecated instead use {@link #sourceDirectories}. For version 3.0.0, this parameter is only defined to break
      *             the build if you use it!
      */
@@ -267,7 +267,7 @@ public abstract class AbstractCheckstyleReport
     // Compatibility with all Maven 3: default of 'project.compileSourceRoots' is done manually because of MNG-5440
     @Parameter
     private List<String> sourceDirectories;
-    
+
     /**
      * Specifies the location of the test source directory to be used for Checkstyle.
      *
@@ -278,7 +278,7 @@ public abstract class AbstractCheckstyleReport
     @Parameter
     @Deprecated
     private File testSourceDirectory;
-    
+
     /**
      * Specifies the location of the test source directories to be used for Checkstyle.
      * Default value is <code>${project.testCompileSourceRoots}</code>.
@@ -355,8 +355,11 @@ public abstract class AbstractCheckstyleReport
 
     /**
      * 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 = "true" )
+    @Parameter( property = "checkstyle.enable.rss", defaultValue = "false" )
+    @Deprecated
     private boolean enableRSS;
 
     /**
@@ -397,7 +400,7 @@ public abstract class AbstractCheckstyleReport
     /**
      * When using custom treeWalkers, specify their names here so the checks
      * inside the treeWalker end up the the rule-summary.
-     * 
+     *
      * @since 2.11
      */
     @Parameter
@@ -406,7 +409,7 @@ public abstract class AbstractCheckstyleReport
     /**
      * Specifies whether modules with a configured severity of <code>ignore</code> should be omitted during Checkstyle
      * invocation.
-     * 
+     *
      * @since 3.0.0
      */
     @Parameter( defaultValue = "false" )
@@ -466,6 +469,7 @@ public abstract class AbstractCheckstyleReport
      * @since 2.4
      */
     @Component( role = CheckstyleRssGenerator.class, hint = "default" )
+    @Deprecated
     protected CheckstyleRssGenerator checkstyleRssGenerator;
 
     /**
@@ -602,7 +606,7 @@ public abstract class AbstractCheckstyleReport
     private List<Artifact> getCheckstylePluginDependenciesAsArtifacts( Map<String, Plugin> plugins, String hint )
     {
         List<Artifact> artifacts = new ArrayList<>();
-        
+
         Plugin checkstylePlugin = plugins.get( plugin.getGroupId() + ":" + plugin.getArtifactId() );
         if ( checkstylePlugin != null )
         {
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 47c3460..bd241b0 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
@@ -65,6 +65,7 @@ public class CheckstyleReportGenerator
 
     private boolean enableFilesSummary;
 
+    @Deprecated
     private boolean enableRSS;
 
     private final SiteTool siteTool;
@@ -97,7 +98,7 @@ public class CheckstyleReportGenerator
         this.enableRulesSummary = true;
         this.enableSeveritySummary = true;
         this.enableFilesSummary = true;
-        this.enableRSS = true;
+        this.enableRSS = false;
         this.iconTool = new IconTool( sink, bundle );
     }
 
@@ -717,7 +718,7 @@ public class CheckstyleReportGenerator
                 return true;
             }
         }
-      
+
         return false;
     }
 
@@ -761,11 +762,13 @@ public class CheckstyleReportGenerator
         this.enableFilesSummary = enableFilesSummary;
     }
 
+    @Deprecated
     public boolean isEnableRSS()
     {
         return enableRSS;
     }
 
+    @Deprecated
     public void setEnableRSS( boolean enableRSS )
     {
         this.enableRSS = enableRSS;
@@ -791,12 +794,12 @@ public class CheckstyleReportGenerator
         this.xrefTestLocation = xrefTestLocation;
     }
 
-    public List<File> getTestSourceDirectories() 
+    public List<File> getTestSourceDirectories()
     {
         return testSourceDirectories;
     }
 
-    public void setTestSourceDirectories( List<File> testSourceDirectories ) 
+    public void setTestSourceDirectories( List<File> testSourceDirectories )
     {
         this.testSourceDirectories = testSourceDirectories;
     }
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
index 149648c..c90adc4 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGenerator.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGenerator.java
@@ -26,6 +26,7 @@ import org.apache.maven.reporting.MavenReportException;
  * @author Olivier Lamy
  * @since 2.4
  */
+@Deprecated
 public interface CheckstyleRssGenerator
 {
     void generateRSS( CheckstyleResults results, CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest )
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
index 356066f..8813217 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGeneratorRequest.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/rss/CheckstyleRssGeneratorRequest.java
@@ -28,6 +28,7 @@ import org.apache.maven.project.MavenProject;
  * @author Olivier Lamy
  * @since 2.4
  */
+@Deprecated
 public class CheckstyleRssGeneratorRequest
 {
     private MavenProject mavenProject;
@@ -35,7 +36,7 @@ public class CheckstyleRssGeneratorRequest
     private String copyright;
 
     private File outputDirectory;
-    
+
     private Log log;
 
     public CheckstyleRssGeneratorRequest( MavenProject mavenProject, String copyright, File outputDirectory, 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
index 03c1280..c8d03dd 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/rss/DefaultCheckstyleRssGenerator.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/rss/DefaultCheckstyleRssGenerator.java
@@ -41,6 +41,7 @@ import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
  * @since 2.4
  */
 @Component( role = CheckstyleRssGenerator.class, hint = "default" )
+@Deprecated
 public class DefaultCheckstyleRssGenerator
     implements CheckstyleRssGenerator
 {
@@ -78,5 +79,5 @@ public class DefaultCheckstyleRssGenerator
             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
index 4ee2b7a..0919bd2 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/rss/VelocityTemplate.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/rss/VelocityTemplate.java
@@ -51,6 +51,7 @@ import java.nio.charset.StandardCharsets;
  * @author <a href="mailto:joakim@erdfelt.net">Joakim Erdfelt</a>
  *
  */
+@Deprecated
 public class VelocityTemplate
 {
     private String templateDirectory;
@@ -94,7 +95,7 @@ public class VelocityTemplate
         {
             outputFile.getParentFile().mkdirs();
         }
-        
+
         try ( Writer writer = new OutputStreamWriter( new FileOutputStream( outputFile ), StandardCharsets.UTF_8 ) )
         {
             getVelocity().getEngine().mergeTemplate( templateDirectory + "/" + template, context, writer );