prevent Javadoc from failing gradle build

2019-02-19 02:20发布

I’m trying to upload my Library project to jCenter. when I run gradlew install I’m getting the error:

Execution failed for task ':myLibraryProject:javadoc'

I added the code below to my library project:

task androidJavadocs(type: Javadoc) {
    failOnError false // add this line
    source = android.sourceSets.main.java.getSrcDirs()
}

but still I get

"Javadoc generation failed. Generated Javadoc options file..."

I've also tried the accepted answer from here: Generate JavaDocs with Android Gradle plugin

Can I disable the generation of Javadocs, or maybe try to continue with the build although the failure?

2条回答
可以哭但决不认输i
2楼-- · 2019-02-19 03:19

I don't recommend disabling JavaDoc generation. Instead, try just running

./gradlew javadoc

This should give you detailed log output about the warnings and errors that are occurring. Fixing these errors should prevent JavaDoc from causing the failure.

查看更多
你好瞎i
3楼-- · 2019-02-19 03:19

In our case, the problem was that we had to remove .gitignore files. They were listed in the file javadoc.options. After that, the task finished successfully.

查看更多
登录 后发表回答