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

slachiewicz 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 0c80b0d9 Scope the JVM options announcement to MJAVADOC-538
0c80b0d9 is described below

commit 0c80b0d919b0d9f1ff7731fc5b396ec87cd3fd62
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Wed Nov 4 14:09:28 2026 +0000

    Scope the JVM options announcement to MJAVADOC-538
    
    invoker.environmentVariables ignores names that do not start with a letter, 
so the IT sets
    JAVA_TOOL_OPTIONS; the plugin filters its 'Picked up' line the same way as 
_JAVA_OPTIONS.
---
 pom.xml                                         |  4 +---
 src/it/projects/MJAVADOC-538/invoker.properties |  2 ++
 src/it/projects/MJAVADOC-538/pom.xml            | 23 --------------------
 src/it/projects/MJAVADOC-538/verify.groovy      | 29 +++++++++++++++++++++++++
 4 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/pom.xml b/pom.xml
index b086675b..e8028bc8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -499,9 +499,7 @@ under the License.
               <!-- each IT is a short-lived JVM: C2 compilation and parallel 
GC only add startup time -->
               <mavenOpts>-XX:TieredStopAtLevel=1 -XX:+UseSerialGC</mavenOpts>
               <environmentVariables>
-                <!-- required for MJAVADOC-538 -->
-                <_JAVA_OPTIONS>-Dabc=def</_JAVA_OPTIONS>
-                <!-- clen up the MAVEN_ARGS for the ITs -->
+                <!-- clean up the MAVEN_ARGS for the ITs -->
                 <MAVEN_ARGS />
               </environmentVariables>
             </configuration>
diff --git a/src/it/projects/MJAVADOC-538/invoker.properties 
b/src/it/projects/MJAVADOC-538/invoker.properties
index a4e250da..812dbb6d 100644
--- a/src/it/projects/MJAVADOC-538/invoker.properties
+++ b/src/it/projects/MJAVADOC-538/invoker.properties
@@ -16,3 +16,5 @@
 # under the License.
 
 invoker.goals=clean javadoc:javadoc
+# the JVM announces this on stderr as 'Picked up JAVA_TOOL_OPTIONS: ...', 
which must not count as a javadoc warning
+invoker.environmentVariables.JAVA_TOOL_OPTIONS = -Dabc=def
diff --git a/src/it/projects/MJAVADOC-538/pom.xml 
b/src/it/projects/MJAVADOC-538/pom.xml
index 8d9de8ca..5b18a941 100644
--- a/src/it/projects/MJAVADOC-538/pom.xml
+++ b/src/it/projects/MJAVADOC-538/pom.xml
@@ -46,27 +46,4 @@
     </pluginManagement>
   </build>
 
-  <profiles>
-    <profile>
-      <id>java10+</id>
-      <activation>
-        <jdk>10</jdk>
-      </activation>
-      <build>
-        <pluginManagement>
-          <plugins>
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-javadoc-plugin</artifactId>
-              <configuration>
-                <additionalOptions>
-                  <option>-html4</option>
-                </additionalOptions>
-              </configuration>
-            </plugin>
-          </plugins>
-        </pluginManagement>
-      </build>
-    </profile>
-  </profiles>
 </project>
diff --git a/src/it/projects/MJAVADOC-538/verify.groovy 
b/src/it/projects/MJAVADOC-538/verify.groovy
new file mode 100644
index 00000000..f272e8ad
--- /dev/null
+++ b/src/it/projects/MJAVADOC-538/verify.groovy
@@ -0,0 +1,29 @@
+/*
+ * 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
+
+// the forked javadoc JVM did see the option, so the filter in 
JavadocOutputStreamConsumer was exercised
+assert log.contains( 'Picked up JAVA_TOOL_OPTIONS: -Dabc=def' ) : 
'JAVA_TOOL_OPTIONS did not reach the forked JVM'
+// and its announcement was neither reported as a javadoc warning nor failed 
the build (failOnWarnings=true)
+assert !log.contains( '[WARNING] Picked up JAVA_TOOL_OPTIONS' ) : 'JVM 
announcement was logged as a javadoc warning'
+assert !log.contains( 'Javadoc Warnings' )
+assert !log.contains( 'Unable to find the javadoc version' )
+assert !log.contains( 'Unable to parse javadoc version' )
+assert new File( basedir, 'target/reports/apidocs/foo/bar/MyClass.html' 
).exists()

Reply via email to