Skip to content

Commit f268df8

Browse files
committed
Cannot access 'failOnError': it is private in 'Javadoc'
1 parent 6d7ba88 commit f268df8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

build.gradle.kts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,16 @@ if (!version.toString().endsWith("-SNAPSHOT")) {
119119
}
120120
}
121121

122-
tasks.withType<Javadoc> {
123-
failOnError = false
122+
tasks.withType<Javadoc>().configureEach {
123+
// Use reflection to access the private field
124+
try {
125+
val field = Javadoc::class.java.getDeclaredField("failOnError")
126+
field.isAccessible = true
127+
field.setBoolean(this, false)
128+
} catch (e: Exception) {
129+
logger.warn("Could not set failOnError: ${e.message}")
130+
}
131+
124132
(options as StandardJavadocDocletOptions).encoding = "UTF-8"
125133
if (JavaVersion.current().isJava9Compatible) {
126134
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)

0 commit comments

Comments
 (0)