Skip to content

Commit

Permalink
[MPMD-312] Upgrade to PMD 6.37.0
Browse files Browse the repository at this point in the history
Add integration test for java 17
  • Loading branch information
adangel committed Jul 31, 2021
1 parent 9478c7e commit 89ce9fe
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -89,7 +89,7 @@ under the License.
<doxiaVersion>1.9.1</doxiaVersion>
<doxiaSitetoolsVersion>1.9.2</doxiaSitetoolsVersion>
<javaVersion>8</javaVersion><!-- Because PMD 6.35.0+ requires Java 8 -->
<pmdVersion>6.36.0</pmdVersion>
<pmdVersion>6.37.0</pmdVersion>
<slf4jVersion>1.7.25</slf4jVersion>
<sitePluginVersion>3.7.1</sitePluginVersion>
<projectInfoReportsPluginVersion>3.0.0</projectInfoReportsPluginVersion>
Expand Down
19 changes: 19 additions & 0 deletions src/it/MPMD-312-JDK17/invoker.properties
@@ -0,0 +1,19 @@
# 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.java.version = 17+
invoker.goals = clean verify
82 changes: 82 additions & 0 deletions src/it/MPMD-312-JDK17/pom.xml
@@ -0,0 +1,82 @@
<?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-312-JDK17</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<target>${java.version}</target>
<source>${java.version}</source>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<skipPmdError>false</skipPmdError>
<skip>false</skip>
<failOnViolation>true</failOnViolation>
<failurePriority>4</failurePriority>
<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>
<id>default</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
25 changes: 25 additions & 0 deletions src/it/MPMD-312-JDK17/src/main/java/com/mycompany/app/App.java
@@ -0,0 +1,25 @@
package com.mycompany.app;

/*
* 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.
*/

public class App
{

}
28 changes: 28 additions & 0 deletions src/it/MPMD-312-JDK17/src/main/java/com/mycompany/app/Foo.java
@@ -0,0 +1,28 @@
/*
* 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.
*/

import java.util.ArrayList;

public class Foo
{
public Foo( final ArrayList<String> foo )
{
}

}
22 changes: 22 additions & 0 deletions src/it/MPMD-312-JDK17/verify.groovy
@@ -0,0 +1,22 @@

/*
* 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()
2 changes: 1 addition & 1 deletion src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
Expand Up @@ -72,7 +72,7 @@ public class PmdReport
* with the default PMD version are
* currently <code>1.3</code>, <code>1.4</code>, <code>1.5</code>, <code>1.6</code>, <code>1.7</code>,
* <code>1.8</code>, <code>9</code>, <code>10</code>, <code>11</code>, <code>12</code>, <code>13</code>,
* <code>14</code>, <code>15</code>, and <code>16</code>.
* <code>14</code>, <code>15</code>, <code>16</code>, and <code>17</code>.
*
* <p> You can override the default PMD version by specifying PMD as a dependency,
* see <a href="examples/upgrading-PMD-at-runtime.html">Upgrading PMD at Runtime</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm
Expand Up @@ -88,7 +88,7 @@ Upgrading PMD at Runtime
*--------------------------------------------------------------------------------*--------------------------------------------------*
| <<maven-pmd-plugin>> | <<PMD>> |
*--------------------------------------------------------------------------------*--------------------------------------------------*
| {{{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}} |
| {{{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}} |
*--------------------------------------------------------------------------------*--------------------------------------------------*
| {{{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}} |
*--------------------------------------------------------------------------------*--------------------------------------------------*
Expand Down

0 comments on commit 89ce9fe

Please sign in to comment.