25
25
import java .io .IOException ;
26
26
import java .io .OutputStream ;
27
27
import java .util .ArrayList ;
28
- import java .util .Calendar ;
29
28
import java .util .List ;
30
29
import java .util .Locale ;
31
30
import java .util .Map ;
51
50
import org .apache .maven .plugins .checkstyle .exec .CheckstyleExecutorException ;
52
51
import org .apache .maven .plugins .checkstyle .exec .CheckstyleExecutorRequest ;
53
52
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 ;
56
53
import org .apache .maven .reporting .AbstractMavenReport ;
57
54
import org .apache .maven .reporting .MavenReportException ;
58
55
import org .codehaus .plexus .configuration .PlexusConfiguration ;
67
64
*
68
65
*/
69
66
public abstract class AbstractCheckstyleReport extends AbstractMavenReport {
70
- public static final String PLUGIN_RESOURCES = "org/apache/maven/plugins/checkstyle" ;
71
-
72
67
protected static final String JAVA_FILES = "**\\ /*.java" ;
73
68
74
69
private static final String DEFAULT_CONFIG_LOCATION = "sun_checks.xml" ;
@@ -342,15 +337,6 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport {
342
337
@ Parameter (property = "checkstyle.enable.files.summary" , defaultValue = "true" )
343
338
private boolean enableFilesSummary ;
344
339
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
-
354
340
/**
355
341
* The Plugin Descriptor
356
342
*/
@@ -446,15 +432,6 @@ public abstract class AbstractCheckstyleReport extends AbstractMavenReport {
446
432
@ Component
447
433
protected ResourceManager locator ;
448
434
449
- /**
450
- * CheckstyleRssGenerator.
451
- *
452
- * @since 2.4
453
- */
454
- @ Component (role = CheckstyleRssGenerator .class , hint = "default" )
455
- @ Deprecated
456
- protected CheckstyleRssGenerator checkstyleRssGenerator ;
457
-
458
435
/**
459
436
* @since 2.5
460
437
*/
@@ -519,14 +496,7 @@ public void executeReport(Locale locale) throws MavenReportException {
519
496
CheckstyleResults results = checkstyleExecutor .executeCheckstyle (request );
520
497
521
498
ResourceBundle bundle = getBundle (locale );
522
- generateReportStatics ();
523
499
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
-
530
500
} catch (CheckstyleException e ) {
531
501
throw new MavenReportException ("Failed during checkstyle configuration" , e );
532
502
} catch (CheckstyleExecutorException e ) {
@@ -647,32 +617,6 @@ protected DefaultLogger getConsoleListener() throws MavenReportException {
647
617
return consoleListener ;
648
618
}
649
619
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
-
676
620
private void generateMainReport (CheckstyleResults results , ResourceBundle bundle , String configLocation ) {
677
621
CheckstyleReportGenerator generator =
678
622
new CheckstyleReportGenerator (getSink (), bundle , project .getBasedir (), siteTool , configLocation );
@@ -681,7 +625,6 @@ private void generateMainReport(CheckstyleResults results, ResourceBundle bundle
681
625
generator .setEnableRulesSummary (enableRulesSummary );
682
626
generator .setEnableSeveritySummary (enableSeveritySummary );
683
627
generator .setEnableFilesSummary (enableFilesSummary );
684
- generator .setEnableRSS (enableRSS );
685
628
generator .setCheckstyleConfig (results .getConfiguration ());
686
629
if (linkXRef ) {
687
630
initializeXrefLocation (generator );
0 commit comments