Skip to content

Commit 10f4eda

Browse files
christianhujeradangel
authored andcommitted
[MPMD-295] - Maven PMD Plugin fails on Java 13: Unsupported targetJdk value '13'
* Bump PMD version to 6.19.0 * Update documentation with supported targetJdk values
1 parent 07e59b2 commit 10f4eda

File tree

7 files changed

+184
-3
lines changed

7 files changed

+184
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ under the License.
8888
<mavenVersion>3.0</mavenVersion>
8989
<doxiaVersion>1.7</doxiaVersion>
9090
<javaVersion>7</javaVersion><!-- Because PMD 5.4+ requires Java 7 -->
91-
<pmdVersion>6.17.0</pmdVersion>
91+
<pmdVersion>6.19.0</pmdVersion>
9292
<sitePluginVersion>3.7.1</sitePluginVersion>
9393
<projectInfoReportsPluginVersion>3.0.0</projectInfoReportsPluginVersion>
9494
</properties>
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 = 13
19+
invoker.goals = clean verify

src/it/MPMD-295-JDK13/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>empty-rulests</artifactId>
27+
<version>1.0-SNAPSHOT</version>
28+
<name>my-app</name>
29+
30+
<properties>
31+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
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>13</target>
43+
<source>13</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>13</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+
}
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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,14 @@ public class PmdReport
9393
extends AbstractPmdReport
9494
{
9595
/**
96-
* The target JDK to analyze based on. Should match the source used in the compiler plugin. Valid values are
96+
* The target JDK to analyze based on. Should match the source used in the compiler plugin. Valid values
97+
* with the default PMD version are
9798
* currently <code>1.3</code>, <code>1.4</code>, <code>1.5</code>, <code>1.6</code>, <code>1.7</code>,
98-
* <code>1.8</code>, <code>9</code>, <code>10</code>, <code>11</code>, and <code>12</code>.
99+
* <code>1.8</code>, <code>9</code>, <code>10</code>, <code>11</code>, <code>12</code>, and <code>13</code>.
100+
*
101+
* <p> You can override the default PMD version by specifying PMD as a dependency,
102+
* see <a href="examples/upgrading-PMD-at-runtime.html">Upgrading PMD at Runtime</a>.</p>
103+
*
99104
* <p>
100105
* <b>Note:</b> this parameter is only used if the language parameter is set to <code>java</code>.
101106
* </p>

0 commit comments

Comments
 (0)