5

I'm using com.github.dcendents:android-maven-gradle-plugin to generate a POM file and then upload it to Bintray. Though when I run ./gradlew install, the script invokes Maven's install command, and FAILS on generating JavaDoc. I've already searched everywhere to find how to disable javadoc errors, but there is always one more issue I cannot solve.

Tested: 'failOnError false', disabling javadoc task (wasn't allowed), adding various parameters to install task for POM generation, tried different flags on the CLI, etc.

I've used this tutorial.

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
milosmns
  • 3,595
  • 4
  • 36
  • 48

2 Answers2

4

for me running gradlew install without javadoc generation was enough to overcome this, my crash was due to a stricter javadoc format requirement added in java 8 and one of my libs was at fault

gradlew install -xjavadoc
Liran Cohen
  • 1,190
  • 1
  • 9
  • 16
0

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

// 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 is that androidJavadoc and javadoc tasks work differently, AND that Gradle parses the file top to bottom. It does matter where you define your stuff.

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

A quick fix for most of my Gradle issues - put everything you read on StackOverflow to the end of file. It's that stupid. 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
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
milosmns
  • 3,595
  • 4
  • 36
  • 48