You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ad...@apache.org on 2018/01/10 18:54:58 UTC

[maven-pmd-plugin] branch master updated: [MPMD-128] Xref link generation regression with Maven 3

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

adangel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new b727446  [MPMD-128] Xref link generation regression with Maven 3
b727446 is described below

commit b727446e42e9fe8cd3086b4e0838856656fa07c6
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Wed Jan 10 19:47:12 2018 +0100

    [MPMD-128] Xref link generation regression with Maven 3
    
    Submitted by: Marc Rohlfs
    
    * Added integration test and adjusted to current PMD/m-pmd-p version
---
 src/it/MPMD-128-xref-link/invoker.properties       | 18 +++++++
 src/it/MPMD-128-xref-link/pom.xml                  | 63 ++++++++++++++++++++++
 .../src/main/config/pmd/rules.xml                  | 26 +++++++++
 .../src/main/java/mpmd128/App.java                 | 35 ++++++++++++
 src/it/MPMD-128-xref-link/verify.groovy            | 27 ++++++++++
 5 files changed, 169 insertions(+)

diff --git a/src/it/MPMD-128-xref-link/invoker.properties b/src/it/MPMD-128-xref-link/invoker.properties
new file mode 100644
index 0000000..67f758a
--- /dev/null
+++ b/src/it/MPMD-128-xref-link/invoker.properties
@@ -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 site
\ No newline at end of file
diff --git a/src/it/MPMD-128-xref-link/pom.xml b/src/it/MPMD-128-xref-link/pom.xml
new file mode 100644
index 0000000..32dcaba
--- /dev/null
+++ b/src/it/MPMD-128-xref-link/pom.xml
@@ -0,0 +1,63 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins.pmd.it</groupId>
+  <artifactId>MPMD-128-xref-link</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>MPMD-128-xref-link</name>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-site-plugin</artifactId>
+        <version>@sitePluginVersion@</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <reporting>
+   <plugins>
+    <plugin>
+      <groupId>org.apache.maven.plugins</groupId>
+      <artifactId>maven-pmd-plugin</artifactId>
+      <version>@project.version@</version>
+      <configuration>
+        <rulesets>
+          <ruleset>src/main/config/pmd/rules.xml</ruleset>
+        </rulesets>
+      </configuration>
+    </plugin>
+    <plugin>
+      <groupId>org.apache.maven.plugins</groupId>
+      <artifactId>maven-jxr-plugin</artifactId>
+      <version>2.3</version>
+    </plugin>
+   </plugins>
+  </reporting>
+</project>
diff --git a/src/it/MPMD-128-xref-link/src/main/config/pmd/rules.xml b/src/it/MPMD-128-xref-link/src/main/config/pmd/rules.xml
new file mode 100644
index 0000000..048122e
--- /dev/null
+++ b/src/it/MPMD-128-xref-link/src/main/config/pmd/rules.xml
@@ -0,0 +1,26 @@
+<?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.
+-->
+<ruleset name="Custom Ruleset"
+    xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
+
+  <rule ref="category/java/codestyle.xml/UnnecessaryReturn" message="TEST: MPMD-128" />
+</ruleset>
\ No newline at end of file
diff --git a/src/it/MPMD-128-xref-link/src/main/java/mpmd128/App.java b/src/it/MPMD-128-xref-link/src/main/java/mpmd128/App.java
new file mode 100644
index 0000000..8637a5f
--- /dev/null
+++ b/src/it/MPMD-128-xref-link/src/main/java/mpmd128/App.java
@@ -0,0 +1,35 @@
+package mpmd128;
+
+/*
+ * 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.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+        return; // Unnecessary return.
+    }
+
+}
\ No newline at end of file
diff --git a/src/it/MPMD-128-xref-link/verify.groovy b/src/it/MPMD-128-xref-link/verify.groovy
new file mode 100644
index 0000000..2c64027
--- /dev/null
+++ b/src/it/MPMD-128-xref-link/verify.groovy
@@ -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 report = new File( basedir, 'target/site/pmd.html' )
+assert report.exists()
+
+assert 1 == report.getText().count( 'xref/mpmd128/App.html#L32' )

-- 
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <co...@maven.apache.org>'].