You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2013/11/28 06:54:58 UTC
svn commit: r1546291 - in /maven/plugins/trunk/maven-pmd-plugin/src:
it/MPMD-163/ it/empty-rulesets/ it/empty-rulesets/src/
it/empty-rulesets/src/main/ it/empty-rulesets/src/main/java/
it/empty-rulesets/src/main/java/com/ it/empty-rulesets/src/main/jav...
Author: olamy
Date: Thu Nov 28 05:54:57 2013
New Revision: 1546291
URL: http://svn.apache.org/r1546291
Log:
[MPMD-176] updgrade to pmd 5.0.5
Added:
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/invoker.properties (with props)
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/pom.xml
- copied, changed from r1546290, maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/App.java (with props)
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/Foo.java (with props)
maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/verify.groovy (with props)
Modified:
maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-163/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-138/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-142/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-80-included/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-89/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/pom.xml
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java
Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-163/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-163/pom.xml?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-163/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-163/pom.xml Thu Nov 28 05:54:57 2013
@@ -42,6 +42,7 @@ under the License.
<verbose>true</verbose>
<printFailingErrors>true</printFailingErrors>
<failurePriority>0</failurePriority>
+ <skipPmdError>false</skipPmdError>
</configuration>
</plugin>
</plugins>
Added: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/invoker.properties?rev=1546291&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/invoker.properties (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/invoker.properties Thu Nov 28 05:54:57 2013
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.goals = clean verify
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Copied: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/pom.xml (from r1546290, maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml)
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/pom.xml?p2=maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/pom.xml&p1=maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml&r1=1546290&r2=1546291&rev=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/pom.xml Thu Nov 28 05:54:57 2013
@@ -19,60 +19,58 @@ specific language governing permissions
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">
+<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
-
- <groupId>org.apache.maven.plugin.pmd.its</groupId>
- <artifactId>mpmd-168-empty-report</artifactId>
+ <groupId>org.apache.maven.plugin.pmd.it</groupId>
+ <artifactId>empty-rulests</artifactId>
<version>1.0-SNAPSHOT</version>
+ <name>my-app</name>
- <name>MPMD-168 do not skip empty report</name>
- <description>
- Verify the "skipEmptyReport" parameter.
- </description>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
<build>
<plugins>
<plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>@sitePluginVersion@</version>
- </plugin>
- <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
+ <dependencies>
+ <dependency>
+ <groupId>net.sourceforge.pmd</groupId>
+ <artifactId>pmd</artifactId>
+ <version>5.0.5</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <skipPmdError>false</skipPmdError>
+ <skip>false</skip>
+ <failOnViolation>true</failOnViolation>
+ <failurePriority>4</failurePriority>
+ <targetJdk>1.7</targetJdk>
+ <sourceEncoding>UTF-8</sourceEncoding>
+ <minimumTokens>100</minimumTokens>
+ <excludes>
+ <exclude>**/*Bean.java</exclude>
+ <exclude>**/generated/*.java</exclude>
+ </excludes>
+ <excludeRoots>
+ <excludeRoot>target/generated-sources/stubs</excludeRoot>
+ </excludeRoots>
+ <rulesets/>
+ </configuration>
<executions>
<execution>
+ <id>default</id>
+ <phase>verify</phase>
<goals>
<goal>check</goal>
- <goal>cpd-check</goal>
</goals>
</execution>
</executions>
- <configuration>
- <verbose>true</verbose>
- <minimumTokens>25</minimumTokens>
- <sourceEncoding>UTF-8</sourceEncoding>
- <failOnViolation>false</failOnViolation> <!-- force execution of both goals, will be checked with verify-script -->
- </configuration>
</plugin>
</plugins>
</build>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-pmd-plugin</artifactId>
- <version>@project.version@</version>
- <configuration>
- <skipEmptyReport>false</skipEmptyReport>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.3</version>
- </plugin>
- </plugins>
- </reporting>
</project>
Added: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/App.java?rev=1546291&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/App.java (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/App.java Thu Nov 28 05:54:57 2013
@@ -0,0 +1,26 @@
+package com.mycompany.app;
+
+/*
+ * 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.
+ */
+
+public class App
+{
+
+
+}
Propchange: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/App.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/App.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/Foo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/Foo.java?rev=1546291&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/Foo.java (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/Foo.java Thu Nov 28 05:54:57 2013
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+public class Foo
+{
+ public Foo(final ArrayList<String> foo)
+ {
+ }
+
+}
Propchange: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/Foo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/src/main/java/com/mycompany/app/Foo.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/verify.groovy?rev=1546291&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/verify.groovy (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/verify.groovy Thu Nov 28 05:54:57 2013
@@ -0,0 +1,22 @@
+
+/*
+ * 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 buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/verify.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-pmd-plugin/src/it/empty-rulesets/verify.groovy
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-138/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-138/pom.xml?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-138/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-138/pom.xml Thu Nov 28 05:54:57 2013
@@ -60,6 +60,7 @@ under the License.
<verbose>true</verbose>
<minimumTokens>25</minimumTokens>
<failOnViolation>false</failOnViolation> <!-- force execution of both goals, will be checked with verify-script -->
+ <skipPmdError>false</skipPmdError>
</configuration>
</plugin>
</plugins>
Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-142/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-142/pom.xml?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-142/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-142/pom.xml Thu Nov 28 05:54:57 2013
@@ -31,9 +31,9 @@ under the License.
<build>
<pluginManagement>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
<version>@sitePluginVersion@</version>
</plugin>
</plugins>
@@ -49,6 +49,7 @@ under the License.
<excludeRoots>
<excludeRoots>target/generated-sources</excludeRoots>
</excludeRoots>
+ <skipPmdError>false</skipPmdError>
</configuration>
</plugin>
<plugin>
Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168-empty-report/pom.xml Thu Nov 28 05:54:57 2013
@@ -53,6 +53,7 @@ under the License.
<minimumTokens>25</minimumTokens>
<sourceEncoding>UTF-8</sourceEncoding>
<failOnViolation>false</failOnViolation> <!-- force execution of both goals, will be checked with verify-script -->
+ <skipPmdError>false</skipPmdError>
</configuration>
</plugin>
</plugins>
@@ -66,6 +67,7 @@ under the License.
<version>@project.version@</version>
<configuration>
<skipEmptyReport>false</skipEmptyReport>
+ <skipPmdError>false</skipPmdError>
</configuration>
</plugin>
<plugin>
Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168/pom.xml?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-168/pom.xml Thu Nov 28 05:54:57 2013
@@ -53,6 +53,7 @@ under the License.
<minimumTokens>25</minimumTokens>
<sourceEncoding>UTF-8</sourceEncoding>
<failOnViolation>false</failOnViolation> <!-- force execution of both goals, will be checked with verify-script -->
+ <skipPmdError>false</skipPmdError>
</configuration>
</plugin>
</plugins>
@@ -65,6 +66,7 @@ under the License.
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
+ <skipPmdError>false</skipPmdError>
<!-- <skipEmptyReport>true</skipEmptyReport> it's by default true -->
</configuration>
</plugin>
Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-80-included/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-80-included/pom.xml?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-80-included/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-80-included/pom.xml Thu Nov 28 05:54:57 2013
@@ -47,6 +47,7 @@ under the License.
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
+ <skipPmdError>false</skipPmdError>
<includeXmlInSite>true</includeXmlInSite>
</configuration>
</plugin>
Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-89/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-89/pom.xml?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-89/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/mpmd-89/pom.xml Thu Nov 28 05:54:57 2013
@@ -54,6 +54,7 @@ under the License.
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
+ <skipPmdError>false</skipPmdError>
<includeTests>true</includeTests>
<typeResolution>true</typeResolution>
<rulesets>
Modified: maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/pom.xml?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/pom.xml (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/multi-module/pom.xml Thu Nov 28 05:54:57 2013
@@ -68,6 +68,9 @@ under the License.
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
+ <configuration>
+ <skipPmdError>false</skipPmdError>
+ </configuration>
</plugin>
</plugins>
</reporting>
Modified: maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java?rev=1546291&r1=1546290&r2=1546291&view=diff
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java (original)
+++ maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java Thu Nov 28 05:54:57 2013
@@ -138,6 +138,13 @@ public class PmdReport
private PmdReportListener reportListener;
/**
+ * per default pmd executions error are ignored to not break the whole
+ * @since 3.1
+ */
+ @Parameter( property = "pmd.skipPmdError", defaultValue = "true" )
+ private boolean skipPmdError;
+
+ /**
* {@inheritDoc}
*/
public String getName( Locale locale )
@@ -335,7 +342,12 @@ public class PmdReport
}
catch ( Exception e )
{
- getLog().warn( "Failure executing PMD: " + e.getLocalizedMessage(), e );
+ String message = "Failure executing PMD: " + e.getLocalizedMessage();
+ if ( !skipPmdError )
+ {
+ throw new MavenReportException( message, e );
+ }
+ getLog().warn( message, e );
}
// if format is XML, we need to output it even if the file list is empty or we have no violations