I have published an artifact with build.gradle below:
uploadArchives { repositories { mavenDeployer { repository(url: "file://maven") pom.groupId = 'com.totvnow' pom.artifactId = 'tonedetect-lib' pom.version = '0.1.0' } } } task androidJavadocs(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { classifier = 'javadoc' from androidJavadocs.destinationDir } artifacts { archives androidJavadocsJar }
And I successfully get javadoc files files in repo directory:
tonedetect-lib-0.1.0-javadoc.jar tonedetect-lib-0.1.0-javadoc.jar.md5 tonedetect-lib-0.1.0-javadoc.jar.sha1
But when I use it in another module's build.gradle:
buildscript { repositories { jcenter() maven { url 'somepath\\maven' } } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' } } allprojects { repositories { jcenter() maven { url 'somepath\\maven' } } }
and
dependencies { compile 'com.totvnow:tonedetect-lib:0.1.0' }
The Javadoc does not pop up when I use Ctrl-Q on a class in the library. Java codes are fine, and when I click on the class Android Studio gives me the decompiled code without any problem. Also, other dependencies such as support library v4 shows Javadoc correctly.
Does anyone know possible reasons?
You need to call mvn javadoc:fix to fix main Java source files (i.e. inside src/main/java directory) or mvn javadoc:test-fix to fix test Java source files (i.e. inside src/test/java directory).
A Maven artifact classifier is an optional and arbitrary string that gets appended to the generated artifact's name just after its version number. It distinguishes the artifacts built from the same POM but differing in content.
I have no Android Studio experience. However after searching on the internet for a bit I found to following things:
These things may potentially help to get it working:
Applying the idea
plugin and configuring it to download the JavaDoc:
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
File -> Other Settings -> Default Settings... -> Maven -> Importing
and check the boxes to download the sources and documentation.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With