This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release24.09 by this push:
new db993a4994 Improved: javadoc no longer depends on docs.groovy-lang.org
at build time (OFBIZ-13566)
db993a4994 is described below
commit db993a49942d28c3b3b91d8c36fd1b264af0290c
Author: Mridul Pathak <[email protected]>
AuthorDate: Tue Sep 8 16:04:33 2026 +0530
Improved: javadoc no longer depends on docs.groovy-lang.org at build time
(OFBIZ-13566)
docs.groovy-lang.org is frequently unreachable, and since the javadoc task
has failOnError set, a connection timeout there fails the whole task, which has
been breaking trunk, release24.09, and PR builds alike. Switches to
-linkoffline so the required element-list is read from a local copy extracted
from Groovy's own javadoc jar instead of fetched live, while generated links
still point at the real site (also fixes the link from http to https while at
it). Adapted from the trunk fix r [...]
---
build.gradle | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 2b33e9c70b..b6dd345470 100644
--- a/build.gradle
+++ b/build.gradle
@@ -96,9 +96,38 @@ distributions.main.contents.from(rootDir) {
exclude '**/.gradle/**'
}
+// docs.groovy-lang.org is frequently unreachable, failing :javadoc outright.
+// Extract element-list from Groovy's own javadoc jar so -linkoffline doesn't
need
+// the network at build time; generated links still point at the real site.
Reads
+// the version straight off the existing groovy-all dependency instead of a
second
+// hardcoded/variable copy, since Dependabot only reliably bumps a plain
literal
+// dependency notation, not one built from a Gradle ext property.
+def groovyVersion = configurations.implementation.allDependencies
+ .find { it.group == 'org.codehaus.groovy' && it.name == 'groovy-all'
}.version
+
+configurations {
+ groovyJavadocElements {
+ transitive = false // avoid also pulling in groovy's own javadoc jar
+ }
+}
+
+dependencies {
+ groovyJavadocElements
"org.codehaus.groovy:groovy-all:${groovyVersion}:javadoc"
+}
+
+def groovyOfflineLinks =
layout.buildDirectory.dir('javadoc/groovy-offline-package-list')
+
+tasks.register('extractGroovyElementList', Copy) {
+ from({ zipTree(configurations.groovyJavadocElements.singleFile) }) {
+ include 'element-list'
+ }
+ into groovyOfflineLinks
+}
+
javadoc {
title="OFBiz " + getCurrentGitBranch() + " API"
failOnError = true
+ dependsOn extractGroovyElementList
options {
source '17'
encoding 'UTF-8'
@@ -108,13 +137,16 @@ javadoc {
links(
'https://docs.oracle.com/en/java/javase/17/docs/api/',
'https://tomcat.apache.org/tomcat-9.0-doc/servletapi/',
- 'http://docs.groovy-lang.org/docs/groovy-3.0.25/html/api',
'https://commons.apache.org/proper/commons-cli/apidocs'
)
}
options as StandardJavadocDocletOptions
// Generate Javadocs quietly, validate everything except missing
documentation
options.addStringOption('Xdoclint:all,-missing', '-quiet')
+ options.linksOffline(
+ "https://docs.groovy-lang.org/docs/groovy-${groovyVersion}/html/api/",
+ groovyOfflineLinks.get().asFile.path
+ )
}
java {