diff --git a/src/it/MPMD-332-JDK18/invoker.properties b/src/it/MPMD-332-JDK18/invoker.properties new file mode 100644 index 00000000..47521295 --- /dev/null +++ b/src/it/MPMD-332-JDK18/invoker.properties @@ -0,0 +1,20 @@ +# 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 = 18+ +invoker.goals = clean verify +invoker.buildResult = failure diff --git a/src/it/MPMD-332-JDK18/pom.xml b/src/it/MPMD-332-JDK18/pom.xml new file mode 100644 index 00000000..5f45389e --- /dev/null +++ b/src/it/MPMD-332-JDK18/pom.xml @@ -0,0 +1,76 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.pmd.it + MPMD-332-JDK18 + 1.0-SNAPSHOT + + + UTF-8 + 18 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + ${java.version} + ${java.version} + + + + + + + org.apache.maven.plugins + maven-pmd-plugin + @project.version@ + + false + false + false + true + 4 + true + ${java.version} + UTF-8 + 100 + + + + default + verify + + check + + + + + + + diff --git a/src/it/MPMD-332-JDK18/src/main/java/com/mycompany/app/App.java b/src/it/MPMD-332-JDK18/src/main/java/com/mycompany/app/App.java new file mode 100644 index 00000000..8e4972d3 --- /dev/null +++ b/src/it/MPMD-332-JDK18/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 +{ + +} diff --git a/src/it/MPMD-332-JDK18/src/main/java/com/mycompany/app/Foo.java b/src/it/MPMD-332-JDK18/src/main/java/com/mycompany/app/Foo.java new file mode 100644 index 00000000..4823d574 --- /dev/null +++ b/src/it/MPMD-332-JDK18/src/main/java/com/mycompany/app/Foo.java @@ -0,0 +1,30 @@ +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. + */ + +import java.util.ArrayList; + +public class Foo +{ + public Foo( final ArrayList foo ) + { + } + +} diff --git a/src/it/MPMD-332-JDK18/verify.groovy b/src/it/MPMD-332-JDK18/verify.groovy new file mode 100644 index 00000000..ebb6a94c --- /dev/null +++ b/src/it/MPMD-332-JDK18/verify.groovy @@ -0,0 +1,24 @@ + +/* + * 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() +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/main/java/org/apache/maven/plugins/pmd/PmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java index 124deb94..b1a7c1e6 100644 --- a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java +++ b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java @@ -73,7 +73,7 @@ public class PmdReport * with the default PMD version are * currently 1.3, 1.4, 1.5, 1.6, 1.7, * 1.8, 9, 10, 11, 12, 13, - * 14, 15, 16, and 17. + * 14, 15, 16, 17, and 18. * *

You can override the default PMD version by specifying PMD as a dependency, * see Upgrading PMD at Runtime.