This is an automated email from the ASF dual-hosted git repository.
olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 9d1de274 fix: Use actually Javadoc version to determine capabilities
(#1309)
9d1de274 is described below
commit 9d1de27416c54ed884d0ff7c998a37abb4ab5bf5
Author: Niels Basjes <[email protected]>
AuthorDate: Mon Mar 23 02:36:31 2026 +0100
fix: Use actually Javadoc version to determine capabilities (#1309)
* fix: Use actually Javadoc version to determine capabilities
* fix: Run the toolchain tests in Github actions.
---
pom.xml | 4 ++
.../invoker.properties | 4 +-
src/it/projects/GITHUB-1244-ToolChains/pom.xml | 73 ++++++++++++++++++++++
.../src/main/java/nl/basjes/Dummy.java | 27 ++++++++
.../MJAVADOC-704_toolchains/invoker.properties | 2 +-
src/it/projects/MJAVADOC-787/invoker.properties | 2 +-
.../maven/plugins/javadoc/AbstractJavadocMojo.java | 4 +-
7 files changed, 111 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index 46ce146f..4607a3c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,6 +82,9 @@ under the License.
<contributor>
<name>Julian Reschke</name>
</contributor>
+ <contributor>
+ <name>Niels Basjes</name>
+ </contributor>
</contributors>
<prerequisites>
@@ -126,6 +129,7 @@ under the License.
<pluginPluginVersion>${version.maven-plugin-tools}</pluginPluginVersion>
<jarPluginVersion>${version.maven-jar-plugin}</jarPluginVersion>
<sitePluginVersion>${version.maven-site-plugin}</sitePluginVersion>
+ <toolchainPluginVersion>3.2.0</toolchainPluginVersion>
<projectInfoReportsPluginVersion>${version.maven-project-info-reports-plugin}</projectInfoReportsPluginVersion>
<project.build.outputTimestamp>2025-09-16T08:27:46Z</project.build.outputTimestamp>
<slf4jVersion>1.7.36</slf4jVersion>
diff --git a/src/it/projects/MJAVADOC-704_toolchains/invoker.properties
b/src/it/projects/GITHUB-1244-ToolChains/invoker.properties
similarity index 84%
copy from src/it/projects/MJAVADOC-704_toolchains/invoker.properties
copy to src/it/projects/GITHUB-1244-ToolChains/invoker.properties
index 940e2966..fac09c84 100644
--- a/src/it/projects/MJAVADOC-704_toolchains/invoker.properties
+++ b/src/it/projects/GITHUB-1244-ToolChains/invoker.properties
@@ -15,4 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-invoker.toolchain.jdk.version = 11
+# This verifies that Java 21 LTS is used instead of the Java 25 LTS used by
Maven.
+invoker.java.version = 25
+invoker.toolchain.jdk.version = [21,22)
diff --git a/src/it/projects/GITHUB-1244-ToolChains/pom.xml
b/src/it/projects/GITHUB-1244-ToolChains/pom.xml
new file mode 100644
index 00000000..6e37c424
--- /dev/null
+++ b/src/it/projects/GITHUB-1244-ToolChains/pom.xml
@@ -0,0 +1,73 @@
+<?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.javadoc.it</groupId>
+ <artifactId>github-1244-toolchains</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <url>https://github.com/apache/maven-javadoc-plugin/issues/1244</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-toolchains-plugin</artifactId>
+ <version>@toolchainPluginVersion@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>select-jdk-toolchain</goal>
+ </goals>
+ <configuration>
+ <version>[21,22)</version>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>@compilerPluginVersion@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git
a/src/it/projects/GITHUB-1244-ToolChains/src/main/java/nl/basjes/Dummy.java
b/src/it/projects/GITHUB-1244-ToolChains/src/main/java/nl/basjes/Dummy.java
new file mode 100644
index 00000000..d2c7baf3
--- /dev/null
+++ b/src/it/projects/GITHUB-1244-ToolChains/src/main/java/nl/basjes/Dummy.java
@@ -0,0 +1,27 @@
+package nl.basjes;
+
+/*
+ * 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.
+ */
+
+/**
+ * A dummy class
+ */
+public class Dummy {
+
+}
diff --git a/src/it/projects/MJAVADOC-704_toolchains/invoker.properties
b/src/it/projects/MJAVADOC-704_toolchains/invoker.properties
index 940e2966..865eaa5f 100644
--- a/src/it/projects/MJAVADOC-704_toolchains/invoker.properties
+++ b/src/it/projects/MJAVADOC-704_toolchains/invoker.properties
@@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.
-invoker.toolchain.jdk.version = 11
+invoker.toolchain.jdk.version = [11,12)
diff --git a/src/it/projects/MJAVADOC-787/invoker.properties
b/src/it/projects/MJAVADOC-787/invoker.properties
index 965ea1bf..6c1485c1 100644
--- a/src/it/projects/MJAVADOC-787/invoker.properties
+++ b/src/it/projects/MJAVADOC-787/invoker.properties
@@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.
-invoker.toolchain.jdk.version = 1.8
+invoker.toolchain.jdk.version = [8,9)
diff --git
a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index 1981bed2..8ae72d6e 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -1991,7 +1991,7 @@ public abstract class AbstractJavadocMojo extends
AbstractMojo {
//
----------------------------------------------------------------------
List<String> javadocArguments = new ArrayList<>();
- if (JavaVersion.JAVA_VERSION.isAtLeast("23") && !disableNoFonts) {
+ if (javadocRuntimeVersion.isAtLeast("23") && !disableNoFonts) {
javadocArguments.add("--no-fonts");
}
@@ -2741,7 +2741,7 @@ public abstract class AbstractJavadocMojo extends
AbstractMojo {
if (new File(stylesheetfile).exists()) {
return Optional.of(new File(stylesheetfile));
}
- if (JavaVersion.JAVA_VERSION.isAtLeast("23")) {
+ if (javadocRuntimeVersion.isAtLeast("23")) {
return getResource(
new File(new File(javadocOutputDirectory,
"resource-files"), DEFAULT_CSS_NAME), stylesheetfile);
}