Unify JDK specific integration tests
... so that PMD is actually executed and verified
diff --git a/src/it/MPMD-270-325-JDK11/pom.xml b/src/it/MPMD-270-325-JDK11/pom.xml
index e2d050c..e79e700 100644
--- a/src/it/MPMD-270-325-JDK11/pom.xml
+++ b/src/it/MPMD-270-325-JDK11/pom.xml
@@ -28,6 +28,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <java.version>11</java.version>
</properties>
<build>
@@ -38,8 +39,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
- <target>11</target>
- <source>11</source>
+ <target>${java.version}</target>
+ <source>${java.version}</source>
</configuration>
</plugin>
</plugins>
@@ -56,7 +57,7 @@
<failOnViolation>true</failOnViolation>
<failurePriority>4</failurePriority>
<printFailingErrors>true</printFailingErrors>
- <targetJdk>11</targetJdk>
+ <targetJdk>${java.version}</targetJdk>
<sourceEncoding>UTF-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
</configuration>
diff --git a/src/it/MPMD-280-JDK12/invoker.properties b/src/it/MPMD-280-JDK12/invoker.properties
index 1be113e..a85591d 100644
--- a/src/it/MPMD-280-JDK12/invoker.properties
+++ b/src/it/MPMD-280-JDK12/invoker.properties
@@ -16,4 +16,5 @@
# under the License.
invoker.java.version = 12+
-invoker.goals = clean verify
\ No newline at end of file
+invoker.goals = clean verify
+invoker.buildResult = failure
diff --git a/src/it/MPMD-280-JDK12/pom.xml b/src/it/MPMD-280-JDK12/pom.xml
index c76289a..d7046e7 100644
--- a/src/it/MPMD-280-JDK12/pom.xml
+++ b/src/it/MPMD-280-JDK12/pom.xml
@@ -23,12 +23,12 @@
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>empty-rulests</artifactId>
+ <artifactId>MPMD-280-JDK12</artifactId>
<version>1.0-SNAPSHOT</version>
- <name>my-app</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <java.version>12</java.version>
</properties>
<build>
@@ -39,8 +39,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
- <target>12</target>
- <source>12</source>
+ <target>${java.version}</target>
+ <source>${java.version}</source>
</configuration>
</plugin>
</plugins>
@@ -51,21 +51,15 @@
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
+ <linkXRef>false</linkXRef>
<skipPmdError>false</skipPmdError>
<skip>false</skip>
<failOnViolation>true</failOnViolation>
<failurePriority>4</failurePriority>
- <targetJdk>12</targetJdk>
+ <printFailingErrors>true</printFailingErrors>
+ <targetJdk>${java.version}</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>
diff --git a/src/it/MPMD-280-JDK12/src/main/java/com/mycompany/app/Foo.java b/src/it/MPMD-280-JDK12/src/main/java/com/mycompany/app/Foo.java
index 2a5a2bc..4823d57 100644
--- a/src/it/MPMD-280-JDK12/src/main/java/com/mycompany/app/Foo.java
+++ b/src/it/MPMD-280-JDK12/src/main/java/com/mycompany/app/Foo.java
@@ -1,3 +1,5 @@
+package com.mycompany.app;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
diff --git a/src/it/MPMD-280-JDK12/verify.groovy b/src/it/MPMD-280-JDK12/verify.groovy
index 1cd85d4..ebb6a94 100644
--- a/src/it/MPMD-280-JDK12/verify.groovy
+++ b/src/it/MPMD-280-JDK12/verify.groovy
@@ -19,4 +19,6 @@
*/
File buildLog = new File( basedir, 'build.log' )
-assert buildLog.exists()
\ No newline at end of file
+assert buildLog.exists()
+assert buildLog.text.contains( '[INFO] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
+assert !buildLog.text.contains( '[WARNING]' )
diff --git a/src/it/MPMD-295-JDK13/invoker.properties b/src/it/MPMD-295-JDK13/invoker.properties
index 7581147..df22c70 100644
--- a/src/it/MPMD-295-JDK13/invoker.properties
+++ b/src/it/MPMD-295-JDK13/invoker.properties
@@ -17,3 +17,4 @@
invoker.java.version = 13+
invoker.goals = clean verify
+invoker.buildResult = failure
diff --git a/src/it/MPMD-295-JDK13/pom.xml b/src/it/MPMD-295-JDK13/pom.xml
index b20a00c..4e8161a 100644
--- a/src/it/MPMD-295-JDK13/pom.xml
+++ b/src/it/MPMD-295-JDK13/pom.xml
@@ -23,12 +23,12 @@
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>empty-rulests</artifactId>
+ <artifactId>MPMD-295-JDK13</artifactId>
<version>1.0-SNAPSHOT</version>
- <name>my-app</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <java.version>14</java.version>
</properties>
<build>
@@ -39,8 +39,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
- <target>13</target>
- <source>13</source>
+ <target>${java.version}</target>
+ <source>${java.version}</source>
</configuration>
</plugin>
</plugins>
@@ -51,21 +51,15 @@
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
+ <linkXRef>false</linkXRef>
<skipPmdError>false</skipPmdError>
<skip>false</skip>
<failOnViolation>true</failOnViolation>
<failurePriority>4</failurePriority>
- <targetJdk>13</targetJdk>
+ <printFailingErrors>true</printFailingErrors>
+ <targetJdk>${java.version}</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>
diff --git a/src/it/MPMD-295-JDK13/src/main/java/com/mycompany/app/Foo.java b/src/it/MPMD-295-JDK13/src/main/java/com/mycompany/app/Foo.java
index 2a5a2bc..4823d57 100644
--- a/src/it/MPMD-295-JDK13/src/main/java/com/mycompany/app/Foo.java
+++ b/src/it/MPMD-295-JDK13/src/main/java/com/mycompany/app/Foo.java
@@ -1,3 +1,5 @@
+package com.mycompany.app;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
diff --git a/src/it/MPMD-295-JDK13/verify.groovy b/src/it/MPMD-295-JDK13/verify.groovy
index 1cd85d4..ebb6a94 100644
--- a/src/it/MPMD-295-JDK13/verify.groovy
+++ b/src/it/MPMD-295-JDK13/verify.groovy
@@ -19,4 +19,6 @@
*/
File buildLog = new File( basedir, 'build.log' )
-assert buildLog.exists()
\ No newline at end of file
+assert buildLog.exists()
+assert buildLog.text.contains( '[INFO] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
+assert !buildLog.text.contains( '[WARNING]' )
diff --git a/src/it/MPMD-302-JDK14/invoker.properties b/src/it/MPMD-302-JDK14/invoker.properties
index 0963e85..aa1224c 100644
--- a/src/it/MPMD-302-JDK14/invoker.properties
+++ b/src/it/MPMD-302-JDK14/invoker.properties
@@ -17,3 +17,4 @@
invoker.java.version = 14+
invoker.goals = clean verify
+invoker.buildResult = failure
diff --git a/src/it/MPMD-302-JDK14/pom.xml b/src/it/MPMD-302-JDK14/pom.xml
index 60bd58b..9b7c1c7 100644
--- a/src/it/MPMD-302-JDK14/pom.xml
+++ b/src/it/MPMD-302-JDK14/pom.xml
@@ -51,21 +51,15 @@
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
+ <linkXRef>false</linkXRef>
<skipPmdError>false</skipPmdError>
<skip>false</skip>
<failOnViolation>true</failOnViolation>
<failurePriority>4</failurePriority>
+ <printFailingErrors>true</printFailingErrors>
<targetJdk>${java.version}</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>
diff --git a/src/it/MPMD-302-JDK14/src/main/java/com/mycompany/app/Foo.java b/src/it/MPMD-302-JDK14/src/main/java/com/mycompany/app/Foo.java
index 2a5a2bc..4823d57 100644
--- a/src/it/MPMD-302-JDK14/src/main/java/com/mycompany/app/Foo.java
+++ b/src/it/MPMD-302-JDK14/src/main/java/com/mycompany/app/Foo.java
@@ -1,3 +1,5 @@
+package com.mycompany.app;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
diff --git a/src/it/MPMD-302-JDK14/verify.groovy b/src/it/MPMD-302-JDK14/verify.groovy
index 1cd85d4..ebb6a94 100644
--- a/src/it/MPMD-302-JDK14/verify.groovy
+++ b/src/it/MPMD-302-JDK14/verify.groovy
@@ -19,4 +19,6 @@
*/
File buildLog = new File( basedir, 'build.log' )
-assert buildLog.exists()
\ No newline at end of file
+assert buildLog.exists()
+assert buildLog.text.contains( '[INFO] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
+assert !buildLog.text.contains( '[WARNING]' )
diff --git a/src/it/MPMD-302-JDK15/invoker.properties b/src/it/MPMD-302-JDK15/invoker.properties
index c0309db..3026c6f 100644
--- a/src/it/MPMD-302-JDK15/invoker.properties
+++ b/src/it/MPMD-302-JDK15/invoker.properties
@@ -17,3 +17,4 @@
invoker.java.version = 15+
invoker.goals = clean verify
+invoker.buildResult = failure
diff --git a/src/it/MPMD-302-JDK15/pom.xml b/src/it/MPMD-302-JDK15/pom.xml
index 37ea830..8db2e8b 100644
--- a/src/it/MPMD-302-JDK15/pom.xml
+++ b/src/it/MPMD-302-JDK15/pom.xml
@@ -51,21 +51,15 @@
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
+ <linkXRef>false</linkXRef>
<skipPmdError>false</skipPmdError>
<skip>false</skip>
<failOnViolation>true</failOnViolation>
<failurePriority>4</failurePriority>
+ <printFailingErrors>true</printFailingErrors>
<targetJdk>${java.version}</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>
diff --git a/src/it/MPMD-302-JDK15/src/main/java/com/mycompany/app/Foo.java b/src/it/MPMD-302-JDK15/src/main/java/com/mycompany/app/Foo.java
index 2a5a2bc..4823d57 100644
--- a/src/it/MPMD-302-JDK15/src/main/java/com/mycompany/app/Foo.java
+++ b/src/it/MPMD-302-JDK15/src/main/java/com/mycompany/app/Foo.java
@@ -1,3 +1,5 @@
+package com.mycompany.app;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
diff --git a/src/it/MPMD-302-JDK15/verify.groovy b/src/it/MPMD-302-JDK15/verify.groovy
index 1cd85d4..ebb6a94 100644
--- a/src/it/MPMD-302-JDK15/verify.groovy
+++ b/src/it/MPMD-302-JDK15/verify.groovy
@@ -19,4 +19,6 @@
*/
File buildLog = new File( basedir, 'build.log' )
-assert buildLog.exists()
\ No newline at end of file
+assert buildLog.exists()
+assert buildLog.text.contains( '[INFO] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
+assert !buildLog.text.contains( '[WARNING]' )
diff --git a/src/it/MPMD-312-JDK16/invoker.properties b/src/it/MPMD-312-JDK16/invoker.properties
index a18fd49..23d6093 100644
--- a/src/it/MPMD-312-JDK16/invoker.properties
+++ b/src/it/MPMD-312-JDK16/invoker.properties
@@ -17,3 +17,4 @@
invoker.java.version = 16+
invoker.goals = clean verify
+invoker.buildResult = failure
diff --git a/src/it/MPMD-312-JDK16/pom.xml b/src/it/MPMD-312-JDK16/pom.xml
index 07daa62..14983bf 100644
--- a/src/it/MPMD-312-JDK16/pom.xml
+++ b/src/it/MPMD-312-JDK16/pom.xml
@@ -51,21 +51,15 @@
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
+ <linkXRef>false</linkXRef>
<skipPmdError>false</skipPmdError>
<skip>false</skip>
<failOnViolation>true</failOnViolation>
<failurePriority>4</failurePriority>
+ <printFailingErrors>true</printFailingErrors>
<targetJdk>${java.version}</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>
diff --git a/src/it/MPMD-312-JDK16/src/main/java/com/mycompany/app/Foo.java b/src/it/MPMD-312-JDK16/src/main/java/com/mycompany/app/Foo.java
index 2a5a2bc..4823d57 100644
--- a/src/it/MPMD-312-JDK16/src/main/java/com/mycompany/app/Foo.java
+++ b/src/it/MPMD-312-JDK16/src/main/java/com/mycompany/app/Foo.java
@@ -1,3 +1,5 @@
+package com.mycompany.app;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
diff --git a/src/it/MPMD-312-JDK16/verify.groovy b/src/it/MPMD-312-JDK16/verify.groovy
index 1cd85d4..ebb6a94 100644
--- a/src/it/MPMD-312-JDK16/verify.groovy
+++ b/src/it/MPMD-312-JDK16/verify.groovy
@@ -19,4 +19,6 @@
*/
File buildLog = new File( basedir, 'build.log' )
-assert buildLog.exists()
\ No newline at end of file
+assert buildLog.exists()
+assert buildLog.text.contains( '[INFO] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
+assert !buildLog.text.contains( '[WARNING]' )
diff --git a/src/it/MPMD-312-JDK17/invoker.properties b/src/it/MPMD-312-JDK17/invoker.properties
index 523689c..afd052d 100644
--- a/src/it/MPMD-312-JDK17/invoker.properties
+++ b/src/it/MPMD-312-JDK17/invoker.properties
@@ -17,3 +17,4 @@
invoker.java.version = 17+
invoker.goals = clean verify
+invoker.buildResult = failure
diff --git a/src/it/MPMD-312-JDK17/pom.xml b/src/it/MPMD-312-JDK17/pom.xml
index ed1d9df..3064ae2 100644
--- a/src/it/MPMD-312-JDK17/pom.xml
+++ b/src/it/MPMD-312-JDK17/pom.xml
@@ -51,21 +51,15 @@
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
+ <linkXRef>false</linkXRef>
<skipPmdError>false</skipPmdError>
<skip>false</skip>
<failOnViolation>true</failOnViolation>
<failurePriority>4</failurePriority>
+ <printFailingErrors>true</printFailingErrors>
<targetJdk>${java.version}</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>
diff --git a/src/it/MPMD-312-JDK17/src/main/java/com/mycompany/app/Foo.java b/src/it/MPMD-312-JDK17/src/main/java/com/mycompany/app/Foo.java
index 2a5a2bc..4823d57 100644
--- a/src/it/MPMD-312-JDK17/src/main/java/com/mycompany/app/Foo.java
+++ b/src/it/MPMD-312-JDK17/src/main/java/com/mycompany/app/Foo.java
@@ -1,3 +1,5 @@
+package com.mycompany.app;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
diff --git a/src/it/MPMD-312-JDK17/verify.groovy b/src/it/MPMD-312-JDK17/verify.groovy
index 1cd85d4..ebb6a94 100644
--- a/src/it/MPMD-312-JDK17/verify.groovy
+++ b/src/it/MPMD-312-JDK17/verify.groovy
@@ -19,4 +19,6 @@
*/
File buildLog = new File( basedir, 'build.log' )
-assert buildLog.exists()
\ No newline at end of file
+assert buildLog.exists()
+assert buildLog.text.contains( '[INFO] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
+assert !buildLog.text.contains( '[WARNING]' )