You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2013/01/26 20:37:04 UTC

svn commit: r1438951 - in /maven/plugins/trunk/maven-checkstyle-plugin/src: it/MCHECKSTYLE-172/ it/MCHECKSTYLE-172/src/ it/MCHECKSTYLE-172/src/main/ it/MCHECKSTYLE-172/src/main/java/ it/MCHECKSTYLE-172/src/main/java/org/ it/minimal-pom/ main/java/org/a...

Author: dennisl
Date: Sat Jan 26 19:37:04 2013
New Revision: 1438951

URL: http://svn.apache.org/viewvc?rev=1438951&view=rev
Log:
[MCHECKSTYLE-172] Checkstyle Plugin 2.8+ generates an additional aggregate report

Only generate an aggregate report if there is more than one project in the reactor.
There are more things that can be done, like checking if there are any files in the modules. There's already a TODO for that in the code.

Added:
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/invoker.properties   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/pom.xml   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/MyClass.java   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/package.html   (with props)
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/verify.groovy   (with props)
Removed:
    maven/plugins/trunk/maven-checkstyle-plugin/src/test/java/org/apache/maven/plugin/checkstyle/CheckstyleAggregateReportTest.java
Modified:
    maven/plugins/trunk/maven-checkstyle-plugin/src/it/minimal-pom/verify.bsh
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleAggregateReport.java

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/invoker.properties?rev=1438951&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/invoker.properties (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/invoker.properties Sat Jan 26 19:37:04 2013
@@ -0,0 +1 @@
+invoker.goals=clean site

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author Id

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/pom.xml?rev=1438951&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/pom.xml (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/pom.xml Sat Jan 26 19:37:04 2013
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.checkstyle.it</groupId>
+  <artifactId>MCHECKSTYLE-172</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>MCHECKSTYLE-172</name>
+  <description>
+    A single module project should not generate an aggregate report.
+  </description>
+
+  <url>http://maven.apache.org/</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>@pom.version@</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-site-plugin</artifactId>
+        <version>@sitePluginVersion@</version>
+      </plugin>      
+    </plugins>
+  </build>
+  <reporting>
+   <excludeDefaults>true</excludeDefaults>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>@pom.version@</version>
+      </plugin>
+    </plugins>
+  </reporting>
+</project>

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author Id

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/MyClass.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/MyClass.java?rev=1438951&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/MyClass.java (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/MyClass.java Sat Jan 26 19:37:04 2013
@@ -0,0 +1,7 @@
+package org;
+
+/**
+ * Yada yada yada.
+ */
+public class MyClass {
+}

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/MyClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/MyClass.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author Id

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/package.html
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/package.html?rev=1438951&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/package.html (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/package.html Sat Jan 26 19:37:04 2013
@@ -0,0 +1,7 @@
+<html>
+	<head>
+		<title></title>
+	</head>
+	<body>
+	</body>
+</html>

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/src/main/java/org/package.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author Id

Added: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/verify.groovy?rev=1438951&view=auto
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/verify.groovy (added)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/verify.groovy Sat Jan 26 19:37:04 2013
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+File standardReport = new File(basedir, 'target/site/checkstyle.html');
+assert standardReport.exists();
+File aggregateReportFile = new File(basedir, 'target/site/checkstyle-aggregate.html')
+assert !aggregateReportFile.exists();
+
+return true;

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/verify.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-checkstyle-plugin/src/it/MCHECKSTYLE-172/verify.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author Id

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/it/minimal-pom/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/it/minimal-pom/verify.bsh?rev=1438951&r1=1438950&r2=1438951&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/it/minimal-pom/verify.bsh (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/it/minimal-pom/verify.bsh Sat Jan 26 19:37:04 2013
@@ -32,7 +32,7 @@ try
         return false;
     }
 
-    String[] reports = { "checkstyle", "checkstyle-aggregate" };
+    String[] reports = { "checkstyle" };
     for ( String report : reports )
     {
         File reportFile = new File( siteDir, report + ".html" );

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleAggregateReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleAggregateReport.java?rev=1438951&r1=1438950&r2=1438951&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleAggregateReport.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleAggregateReport.java Sat Jan 26 19:37:04 2013
@@ -273,6 +273,6 @@ public class CheckstyleAggregateReport
     public boolean canGenerateReport()
     {
         // TODO: would be good to scan the files here
-        return !skip && project.isExecutionRoot();
+        return !skip && project.isExecutionRoot() && reactorProjects.size() > 1;
     }
 }