Skip to content

Commit 89ce9fe

Browse files
committed
[MPMD-312] Upgrade to PMD 6.37.0
Add integration test for java 17
1 parent 9478c7e commit 89ce9fe

File tree

8 files changed

+179
-3
lines changed

8 files changed

+179
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ under the License.
8989
<doxiaVersion>1.9.1</doxiaVersion>
9090
<doxiaSitetoolsVersion>1.9.2</doxiaSitetoolsVersion>
9191
<javaVersion>8</javaVersion><!-- Because PMD 6.35.0+ requires Java 8 -->
92-
<pmdVersion>6.36.0</pmdVersion>
92+
<pmdVersion>6.37.0</pmdVersion>
9393
<slf4jVersion>1.7.25</slf4jVersion>
9494
<sitePluginVersion>3.7.1</sitePluginVersion>
9595
<projectInfoReportsPluginVersion>3.0.0</projectInfoReportsPluginVersion>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
invoker.java.version = 17+
19+
invoker.goals = clean verify

src/it/MPMD-312-JDK17/pom.xml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
-->
21+
22+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
<groupId>org.apache.maven.plugins.pmd.it</groupId>
26+
<artifactId>MPMD-312-JDK17</artifactId>
27+
<version>1.0-SNAPSHOT</version>
28+
29+
<properties>
30+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31+
<java.version>17</java.version>
32+
</properties>
33+
34+
<build>
35+
<pluginManagement>
36+
<plugins>
37+
<plugin>
38+
<groupId>org.apache.maven.plugins</groupId>
39+
<artifactId>maven-compiler-plugin</artifactId>
40+
<version>3.8.0</version>
41+
<configuration>
42+
<target>${java.version}</target>
43+
<source>${java.version}</source>
44+
</configuration>
45+
</plugin>
46+
</plugins>
47+
</pluginManagement>
48+
<plugins>
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-pmd-plugin</artifactId>
52+
<version>@project.version@</version>
53+
<configuration>
54+
<skipPmdError>false</skipPmdError>
55+
<skip>false</skip>
56+
<failOnViolation>true</failOnViolation>
57+
<failurePriority>4</failurePriority>
58+
<targetJdk>${java.version}</targetJdk>
59+
<sourceEncoding>UTF-8</sourceEncoding>
60+
<minimumTokens>100</minimumTokens>
61+
<excludes>
62+
<exclude>**/*Bean.java</exclude>
63+
<exclude>**/generated/*.java</exclude>
64+
</excludes>
65+
<excludeRoots>
66+
<excludeRoot>target/generated-sources/stubs</excludeRoot>
67+
</excludeRoots>
68+
<rulesets/>
69+
</configuration>
70+
<executions>
71+
<execution>
72+
<id>default</id>
73+
<phase>verify</phase>
74+
<goals>
75+
<goal>check</goal>
76+
</goals>
77+
</execution>
78+
</executions>
79+
</plugin>
80+
</plugins>
81+
</build>
82+
</project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.mycompany.app;
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
public class App
23+
{
24+
25+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import java.util.ArrayList;
21+
22+
public class Foo
23+
{
24+
public Foo( final ArrayList<String> foo )
25+
{
26+
}
27+
28+
}

src/it/MPMD-312-JDK17/verify.groovy

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
21+
File buildLog = new File( basedir, 'build.log' )
22+
assert buildLog.exists()

src/main/java/org/apache/maven/plugins/pmd/PmdReport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class PmdReport
7272
* with the default PMD version are
7373
* currently <code>1.3</code>, <code>1.4</code>, <code>1.5</code>, <code>1.6</code>, <code>1.7</code>,
7474
* <code>1.8</code>, <code>9</code>, <code>10</code>, <code>11</code>, <code>12</code>, <code>13</code>,
75-
* <code>14</code>, <code>15</code>, and <code>16</code>.
75+
* <code>14</code>, <code>15</code>, <code>16</code>, and <code>17</code>.
7676
*
7777
* <p> You can override the default PMD version by specifying PMD as a dependency,
7878
* see <a href="examples/upgrading-PMD-at-runtime.html">Upgrading PMD at Runtime</a>.</p>

src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Upgrading PMD at Runtime
8888
*--------------------------------------------------------------------------------*--------------------------------------------------*
8989
| <<maven-pmd-plugin>> | <<PMD>> |
9090
*--------------------------------------------------------------------------------*--------------------------------------------------*
91-
| {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.15.0/}3.15.0}} | {{{https://pmd.github.io/pmd-6.36.0/}6.36.0}} |
91+
| {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.15.0/}3.15.0}} | {{{https://pmd.github.io/pmd-6.37.0/}6.37.0}} |
9292
*--------------------------------------------------------------------------------*--------------------------------------------------*
9393
| {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.14.0/}3.14.0}} | {{{https://pmd.github.io/pmd-6.29.0/}6.29.0}} |
9494
*--------------------------------------------------------------------------------*--------------------------------------------------*

0 commit comments

Comments
 (0)