Is there a way to disable javadoc crashes in Android Studio with the Maven plugin?

I use com.github.dcendents: android-maven-gradle -plugin to generate a POM file and then upload it to Bintray. Although, when I run ./gradlew install , the script calls the Maven and FAILS install command when generating the JavaDoc. I have already searched everywhere to find out how to disable javadoc errors, but there is always another problem that I cannot solve.

Tested: "failOnError false", disabling the javadoc task (not allowed), adding various parameters to the install task to generate POM, using various flags in the CLI, etc.

I used this tutorial .

+5
source share
2 answers

I finally found the problem. So I had a structure ...

 // GRADLE FILE START Standard task definitions ... !!! JAVADOC DISABLING (basically everything I tried I put here) !!! Importing my maven upload and bintray upload scripts (command: 'apply from') ... Dependencies // GRADLE FILE END 

What I was missing was that the androidJavadoc and javadoc tasks work differently, And that Gradle parses the file from top to bottom. It doesn't matter where you define your things.

So, I naively put the JAVADOC tasks in the middle of the file, and the task :javadoc could not be overwritten, could not be disabled, etc. - because it was created only by the install segment inside pom_install.gradle I imported in the next few lines.

A quick fix for most of my Gradle issues - put everything you read in StackOverflow at the end of the file. This is silly. So the new structure ...

 // GRADLE FILE START Standard task definitions ... Importing my maven upload and bintray upload scripts (command: 'apply from') ... Dependencies ... !!! JAVADOC DISABLING (basically everything I tried I put here) !!! // GRADLE FILE END 
0
source

for me, starting gradlew installation without generating javadoc was enough to overcome this, my failure was due to a more stringent javadoc format requirement added in java 8, and one of my libs was faulty

 gradlew install -xjavadoc 
+4
source

Source: https://habr.com/ru/post/1238001/


All Articles