Author: michaelo
Date: Sun Nov 30 11:08:17 2014
New Revision: 1642536

URL: http://svn.apache.org/r1642536
Log:
[MPMD-187] Report is generated even when skip is true

Contributed-by: Andreas Dangel

Added:
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/invoker.properties
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/pom.xml
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/src/
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/src/main/
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/src/main/java/
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/src/main/java/App.java
    maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/verify.groovy
Modified:
    
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java
    
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReport.java

Added: maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/invoker.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/invoker.properties?rev=1642536&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/invoker.properties 
(added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/invoker.properties Sun 
Nov 30 11:08:17 2014
@@ -0,0 +1,19 @@
+# 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
+invoker.mavenOpts = -Dpmd.skip=true -Dcpd.skip=true

Added: maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/pom.xml?rev=1642536&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/pom.xml (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/pom.xml Sun Nov 30 
11:08:17 2014
@@ -0,0 +1,55 @@
+<?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.plugin.pmd.its</groupId>
+  <artifactId>MPMD-187</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <description>
+    Verify that pmd.skip really skips pmd plugin
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+            <execution>
+                <phase>verify</phase>
+                <goals>
+                    <goal>pmd</goal>
+                    <goal>cpd</goal>
+                </goals>
+            </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: 
maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/src/main/java/App.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/src/main/java/App.java?rev=1642536&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/src/main/java/App.java 
(added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/src/main/java/App.java 
Sun Nov 30 11:08:17 2014
@@ -0,0 +1,23 @@
+/*
+ * 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 
+{
+
+}

Added: maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/verify.groovy
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/verify.groovy?rev=1642536&view=auto
==============================================================================
--- maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/verify.groovy (added)
+++ maven/plugins/trunk/maven-pmd-plugin/src/it/MPMD-187/verify.groovy Sun Nov 
30 11:08:17 2014
@@ -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.
+ */
+
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+
+File pmdXml = new File( basedir, "target/pmd.xml" )
+assert !pmdXml.exists()
+
+File cpdXml = new File( basedir, "target/cpd.xml" )
+assert !cpdXml.exists()

Modified: 
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java?rev=1642536&r1=1642535&r2=1642536&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java
 (original)
+++ 
maven/plugins/trunk/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/CpdReport.java
 Sun Nov 30 11:08:17 2014
@@ -156,6 +156,11 @@ public class CpdReport
 
     public boolean canGenerateReport()
     {
+        if ( skip )
+        {
+            return false;
+        }
+
         boolean result = super.canGenerateReport();
         if ( result )
         {

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=1642536&r1=1642535&r2=1642536&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
 Sun Nov 30 11:08:17 2014
@@ -229,6 +229,11 @@ public class PmdReport
 
     public boolean canGenerateReport()
     {
+        if ( skip )
+        {
+            return false;
+        }
+
         boolean result = super.canGenerateReport();
         if ( result )
         {


Reply via email to