From ee4132f9d0f6f412784e108305524cf3b3a3009a Mon Sep 17 00:00:00 2001 From: rfscholte Date: Mon, 17 Jan 2022 16:22:58 +0100 Subject: [PATCH] [MJAVADOC-704] Javadoc plugin does not respect jdkToolchain --- .../invoker.properties | 19 +++++ .../projects/MJAVADOC-704_toolchains/pom.xml | 78 +++++++++++++++++++ .../src/main/java/com/foo/MyClass.java | 25 ++++++ .../src/main/java/module-info.java | 22 ++++++ .../MJAVADOC-704_toolchains/verify.groovy | 23 ++++++ 5 files changed, 167 insertions(+) create mode 100644 src/it/projects/MJAVADOC-704_toolchains/invoker.properties create mode 100644 src/it/projects/MJAVADOC-704_toolchains/pom.xml create mode 100644 src/it/projects/MJAVADOC-704_toolchains/src/main/java/com/foo/MyClass.java create mode 100644 src/it/projects/MJAVADOC-704_toolchains/src/main/java/module-info.java create mode 100644 src/it/projects/MJAVADOC-704_toolchains/verify.groovy diff --git a/src/it/projects/MJAVADOC-704_toolchains/invoker.properties b/src/it/projects/MJAVADOC-704_toolchains/invoker.properties new file mode 100644 index 000000000..2342848e5 --- /dev/null +++ b/src/it/projects/MJAVADOC-704_toolchains/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.toolchain.jdk.version = 11 +invoker.maven.version = 3.3.1 \ No newline at end of file diff --git a/src/it/projects/MJAVADOC-704_toolchains/pom.xml b/src/it/projects/MJAVADOC-704_toolchains/pom.xml new file mode 100644 index 000000000..08e2c40e8 --- /dev/null +++ b/src/it/projects/MJAVADOC-704_toolchains/pom.xml @@ -0,0 +1,78 @@ + + + + + 4.0.0 + + org.apache.maven.plugins.javadoc.it + mjavadoc704 + 1.0-SNAPSHOT + + https://issues.apache.org/jira/browse/MJAVADOC-704 + + + UTF-8 + + + + + org.apache.commons + commons-lang3 + 3.6 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.9.0 + + 11 + + 11 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + @project.version@ + + + + jar + + + + + 11 + + 11 + + + + + + + diff --git a/src/it/projects/MJAVADOC-704_toolchains/src/main/java/com/foo/MyClass.java b/src/it/projects/MJAVADOC-704_toolchains/src/main/java/com/foo/MyClass.java new file mode 100644 index 000000000..7370ac086 --- /dev/null +++ b/src/it/projects/MJAVADOC-704_toolchains/src/main/java/com/foo/MyClass.java @@ -0,0 +1,25 @@ +package com.foo; + +/* + * 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 MyClass +{ + +} diff --git a/src/it/projects/MJAVADOC-704_toolchains/src/main/java/module-info.java b/src/it/projects/MJAVADOC-704_toolchains/src/main/java/module-info.java new file mode 100644 index 000000000..45f7f3d91 --- /dev/null +++ b/src/it/projects/MJAVADOC-704_toolchains/src/main/java/module-info.java @@ -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. + */ + +module M.N { + requires org.apache.commons.lang3; +} \ No newline at end of file diff --git a/src/it/projects/MJAVADOC-704_toolchains/verify.groovy b/src/it/projects/MJAVADOC-704_toolchains/verify.groovy new file mode 100644 index 000000000..fedfda71b --- /dev/null +++ b/src/it/projects/MJAVADOC-704_toolchains/verify.groovy @@ -0,0 +1,23 @@ +/* + * 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. + */ + +def log = new File( basedir, 'build.log').text + +assert log.count( "[INFO] Toolchain in maven-compiler-plugin: JDK" ) == 2 +assert log.count( "[INFO] Toolchain in maven-javadoc-plugin: JDK" ) == 1 \ No newline at end of file