You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2023/08/14 20:59:31 UTC

[maven-javadoc-plugin] branch MJAVADOC-765 created (now a200702a)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch MJAVADOC-765
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git


      at a200702a [MJAVADOC-765] Fix build with Java 20

This branch includes the following new commits:

     new a200702a [MJAVADOC-765] Fix build with Java 20

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-javadoc-plugin] 01/01: [MJAVADOC-765] Fix build with Java 20

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch MJAVADOC-765
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git

commit a200702a96088989755839632454960803113e21
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Mon Aug 14 22:06:44 2023 +0200

    [MJAVADOC-765] Fix build with Java 20
---
 .github/workflows/maven.yml                        |  7 ++-
 pom.xml                                            |  1 +
 src/it/projects/MJAVADOC-538/pom.xml               |  1 +
 .../src/main/java/foo/bar/MyClass.java             | 60 ++++++++++++----------
 src/it/projects/MJAVADOC-592_detectApiLink/pom.xml |  6 +--
 .../MJAVADOC-592_detectApiLink/verify.groovy       |  4 +-
 src/it/projects/MJAVADOC-599/pom.xml               |  4 +-
 .../maven/plugins/javadoc/FixJavadocMojoTest.java  | 15 ------
 src/test/resources/unit/fix-test/pom.xml           |  6 +--
 9 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index b0b4e3b3..f8b3bc5c 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -26,5 +26,10 @@ jobs:
     name: Verify
     uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3
     with:
+      jdk-matrix: '[ "20", "17", "8" ]'
+      ff-jdk: '20'
       jdk-distribution-matrix: '[ "temurin", "zulu", "microsoft", "liberica", "adopt-openj9" ]'
-      matrix-exclude: '[{ "jdk": "8", "distribution": "microsoft"}]'
+      matrix-exclude: '[{ "jdk": "8", "distribution": "microsoft"},
+      { "jdk": "20", "distribution": "adopt-openj9"}, {"jdk": "20", "distribution": "liberica"},
+      { "jdk": "20", "distribution": "microsoft"}, { "jdk": "20", "distribution": "zulu"}]'
+      verify-fail-fast: false
diff --git a/pom.xml b/pom.xml
index 492caf90..e390a11e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -492,6 +492,7 @@ under the License.
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-invoker-plugin</artifactId>
+            <version>3.6.0</version>
             <configuration>
               <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
               <projectsDirectory>src/it/projects</projectsDirectory>
diff --git a/src/it/projects/MJAVADOC-538/pom.xml b/src/it/projects/MJAVADOC-538/pom.xml
index ecac9181..8d9de8ca 100644
--- a/src/it/projects/MJAVADOC-538/pom.xml
+++ b/src/it/projects/MJAVADOC-538/pom.xml
@@ -48,6 +48,7 @@
 
   <profiles>
     <profile>
+      <id>java10+</id>
       <activation>
         <jdk>10</jdk>
       </activation>
diff --git a/src/it/projects/MJAVADOC-538/src/main/java/foo/bar/MyClass.java b/src/it/projects/MJAVADOC-538/src/main/java/foo/bar/MyClass.java
index 60b458b0..86364fd6 100644
--- a/src/it/projects/MJAVADOC-538/src/main/java/foo/bar/MyClass.java
+++ b/src/it/projects/MJAVADOC-538/src/main/java/foo/bar/MyClass.java
@@ -1,26 +1,34 @@
-package foo.bar;
-
-/*
- * 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.
- */
-/**
- * App class
- */
-public class MyClass
-{
-}
+package foo.bar;
+
+/*
+ * 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.
+ */
+
+/**
+ * App class
+ *
+ */
+public class MyClass
+{
+    /**
+     * Constructor
+     */
+    MyClass()
+    {
+    }
+}
diff --git a/src/it/projects/MJAVADOC-592_detectApiLink/pom.xml b/src/it/projects/MJAVADOC-592_detectApiLink/pom.xml
index 78ecd47d..1f821d99 100644
--- a/src/it/projects/MJAVADOC-592_detectApiLink/pom.xml
+++ b/src/it/projects/MJAVADOC-592_detectApiLink/pom.xml
@@ -25,13 +25,13 @@
   <groupId>org.apache.maven.plugins.javadoc.it</groupId>
   <artifactId>mjavadoc592</artifactId>
   <version>1.0-SNAPSHOT</version>
-  
+
   <url>https://issues.apache.org/jira/browse/MJAVADOC-592</url>
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <maven.compiler.source>7</maven.compiler.source>
-    <maven.compiler.target>7</maven.compiler.target>
+    <maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
+    <maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
   </properties>
 
   <build>
diff --git a/src/it/projects/MJAVADOC-592_detectApiLink/verify.groovy b/src/it/projects/MJAVADOC-592_detectApiLink/verify.groovy
index 674ad5c2..bed3fca1 100644
--- a/src/it/projects/MJAVADOC-592_detectApiLink/verify.groovy
+++ b/src/it/projects/MJAVADOC-592_detectApiLink/verify.groovy
@@ -16,6 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- 
+
 def options = new File(basedir,'target/site/apidocs/options')
-assert options.readLines().dropWhile{it!='-linkoffline'}.get(1).startsWith("'https://docs.oracle.com/javase/7/docs/api'")
+assert options.readLines().dropWhile{it!='-linkoffline'}.get(1).startsWith("'https://docs.oracle.com/javase/8/docs/api")
diff --git a/src/it/projects/MJAVADOC-599/pom.xml b/src/it/projects/MJAVADOC-599/pom.xml
index 3a5c6e6f..9f664973 100644
--- a/src/it/projects/MJAVADOC-599/pom.xml
+++ b/src/it/projects/MJAVADOC-599/pom.xml
@@ -35,8 +35,8 @@
 
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <maven.compiler.source>1.8</maven.compiler.source>
-    <maven.compiler.target>1.8</maven.compiler.target>
+    <maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
+    <maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
   </properties>
 
   <build>
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
index 4a00d9f3..84cd03e3 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
@@ -37,7 +37,6 @@ import org.apache.maven.plugin.testing.AbstractMojoTestCase;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 import org.apache.maven.plugins.javadoc.AbstractFixJavadocMojo.JavaEntityTags;
 import org.apache.maven.shared.invoker.MavenInvocationException;
-import org.codehaus.plexus.languages.java.version.JavaVersion;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -536,20 +535,6 @@ public class FixJavadocMojoTest extends AbstractMojoTestCase {
 
         Properties properties = new Properties();
 
-        if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("12")) {
-            properties.put("maven.compiler.source", "1.7");
-            properties.put("maven.compiler.target", "1.7");
-        } else if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("9")) {
-            properties.put("maven.compiler.source", "1.6");
-            properties.put("maven.compiler.target", "1.6");
-        }
-
-        // @todo unittests shouldn't need to go remote
-        if (JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore("8")) {
-            // ensure that Java7 picks up TLSv1.2 when connecting with Central
-            properties.put("https.protocols", "TLSv1.2");
-        }
-
         JavadocUtil.invokeMaven(
                 log,
                 new File(getBasedir(), "target/local-repo"),
diff --git a/src/test/resources/unit/fix-test/pom.xml b/src/test/resources/unit/fix-test/pom.xml
index cb297750..ba027357 100644
--- a/src/test/resources/unit/fix-test/pom.xml
+++ b/src/test/resources/unit/fix-test/pom.xml
@@ -25,10 +25,10 @@
   <version>1.1-SNAPSHOT</version>
   <name>Javadoc Test Project</name>
   <packaging>jar</packaging>
-  
+
   <properties>
-    <maven.compiler.source>1.5</maven.compiler.source>
-    <maven.compiler.target>1.5</maven.compiler.target>
+    <maven.compiler.source>8</maven.compiler.source>
+    <maven.compiler.target>8</maven.compiler.target>
   </properties>
 
   <build>