Skip to content

Commit 2ecd578

Browse files
committed
[MPMD-348] - Support Java 19
1 parent 10d345c commit 2ecd578

File tree

7 files changed

+208
-1
lines changed

7 files changed

+208
-1
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 = 1.8+
19+
20+
# available toolchains under linux:
21+
# https://github.com/apache/infrastructure-p6/blob/production/modules/build_nodes/files/toolchains.xml
22+
# https://github.com/apache/infrastructure-puppet/blob/deployment/modules/build_slaves/files/toolchains.xml
23+
24+
# the jdk toolchain "19:openjdk" is selected in pom.xml
25+
invoker.toolchain.jdk.version = 19
26+
invoker.toolchain.jdk.vendor = openjdk
27+
28+
invoker.goals = clean verify
29+
invoker.buildResult = failure

src/it/MPMD-348-JDK19/pom.xml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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-348-JDK19</artifactId>
27+
<version>1.0-SNAPSHOT</version>
28+
29+
<properties>
30+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31+
<java.version>19</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.10.1</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+
<linkXRef>false</linkXRef>
55+
<skipPmdError>false</skipPmdError>
56+
<skip>false</skip>
57+
<failOnViolation>true</failOnViolation>
58+
<failurePriority>4</failurePriority>
59+
<printFailingErrors>true</printFailingErrors>
60+
<targetJdk>${java.version}</targetJdk>
61+
<sourceEncoding>UTF-8</sourceEncoding>
62+
<minimumTokens>100</minimumTokens>
63+
</configuration>
64+
<executions>
65+
<execution>
66+
<id>default</id>
67+
<phase>verify</phase>
68+
<goals>
69+
<goal>check</goal>
70+
</goals>
71+
</execution>
72+
</executions>
73+
</plugin>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-toolchains-plugin</artifactId>
77+
<version>3.1.0</version>
78+
<executions>
79+
<execution>
80+
<goals>
81+
<goal>toolchain</goal>
82+
</goals>
83+
</execution>
84+
</executions>
85+
<configuration>
86+
<toolchains>
87+
<jdk>
88+
<version>${java.version}</version>
89+
<vendor>openjdk</vendor>
90+
</jdk>
91+
</toolchains>
92+
</configuration>
93+
</plugin>
94+
</plugins>
95+
</build>
96+
</project>
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
import java.util.ArrayList;
23+
24+
public class Foo
25+
{
26+
public Foo( final ArrayList<String> foo )
27+
{
28+
}
29+
30+
}

src/it/MPMD-348-JDK19/verify.groovy

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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()
23+
assert buildLog.text.contains( '[INFO] PMD Failure: com.mycompany.app.Foo:26 Rule:UnusedFormalParameter Priority:3' )
24+
assert !buildLog.text.contains( '[WARNING]' )

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

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

src/site/markdown/releasenotes.md

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ under the License.
2929

3030
**GitHub:** <https://github.com/apache/maven-pmd-plugin/releases/tag/maven-pmd-plugin-3.18.0>
3131

32+
### 🚀 New features and improvements
33+
* [MPMD-348](https://issues.apache.org/jira/browse/MPMD-348) - Support Java 19
34+
3235
### 📦 Dependency updates
3336
* [MPMD-345](https://issues.apache.org/jira/browse/MPMD-345) - Upgrade to PMD 6.47.0
3437
* [MPMD-347](https://issues.apache.org/jira/browse/MPMD-347) - Upgrade to PMD 6.48.0

0 commit comments

Comments
 (0)