I am new to gradle, and I am trying to run javadoc using gradle. I have followed the gradle javadoc page, so I have added my next task in the build.gradle:
apply plugin: 'java'
task myJavadocs(type: Javadoc) {
source = sourceSets.main.allJava }
My problem is, that none of the libraries of my project are added, so I get a lot of errors like the next one:
MyClass.java:7: package net.sf.oval.constraint does not exist import net.sf.oval.constraint.NotNull;
What am I doing wrong?
Thanks for your time,
Rafael
The Java Library plugin expands the capabilities of the Java plugin by providing specific knowledge about Java libraries. In particular, a Java library exposes an API to consumers (i.e., other projects using the Java or the Java Library plugin).
Note: You can't use the compileOnly configuration with AAR dependencies. runtimeOnly. Gradle adds the dependency to the build output only, for use during runtime. That is, it is not added to the compile classpath. This configuration behaves just like apk (which is now deprecated).
You have to configure the class path of your Javadoc task. Something like:
myJavadocs {
classpath = configurations.compile
}
For further configuration options, see the DSL reference.
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