-
Notifications
You must be signed in to change notification settings - Fork 381
Cannot link to javadoc from jdk11's javadoc tool #801
Comments
cc: @dapengzhang0 |
I just searched for similar issues on SO and found this https://stackoverflow.com/questions/33866209/linking-to-javadoc-io-using-javadoc-link-option not tested it out yet. |
From the above SO comments, I found a workaround using
To fix the original issue, I think grpc javadoc need to generate a |
I tried a few things with gradle, but I was unable to change the failure behavior. I'm not sure whether this is my fault for not correctly configuring the build or the suggestion simply not working.
If you can explain me how I can configure my build tool (gradle 5) to do that...
I would appreciate any server side fix, that does not require any build tool hacks in consuming lib build tool scripts. |
@ST-DDT Can you provide a simple gradle file for your |
Here a packaged test project: test.zip build.gradle apply plugin: 'java'
tasks.withType(Javadoc) {
def links = [
'https://docs.oracle.com/javase/8/docs/api/',
'https://grpc.io/grpc-java/javadoc/'
];
options.setLinks(links)
} Directory-Structure
I don't know whether you need the gradle stuff as well, for my tests i copied them from here. Output-JDK8 $ ./gradlew javadoc
Starting a Gradle Daemon, 3 incompatible and 2 stopped Daemons could not be reused, use --status for details
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :javadoc UP-TO-DATE
BUILD SUCCESSFUL in 4s
2 actionable tasks: 2 up-to-date Output-JDK11 $ ./gradlew javadoc
Starting a Gradle Daemon, 3 incompatible and 3 stopped Daemons could not be reused, use --status for details
> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :javadoc
javadoc: error - Error fetching URL: https://grpc.io/grpc-java/javadoc/
1 error
> Task :javadoc FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':javadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): 'C:\Users\Daniel\git\grpc\test\build\tmp\javadoc\javadoc.options'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
2 actionable tasks: 2 executed |
Thank you @ST-DDT , that will be very helpful. |
Solution: Using the URL Edit: the above solution is not working.
The problem with |
I can confirm that using the other link it does not throw an error anymore. However it does not generate links to the grpc classes either (including jdk 8). Is that page updated yet? You can verify that behavior by changing the return type of the example config to an grpc-java class. |
Right, it links to the github pages which are not in javadoc format. My mistake.
I tested with a few changes and reverted them back. So it is unchanged. |
@ST-DDT Using jdk 11.0.2, the issue is gone.
|
If I try to run
javadoc
with the-link
option I get an error for the grpc-java's javadoc page.The issue can be reproduced like this:
Test.java
Command line
javadoc -link 'https://grpc.io/grpc-java/javadoc/' Test.java
Error message with jdk 11
Unfortunately I couldn't get any details why it failed.
I also tried it with other javadoc pages and that seems to work without problems, even if they are generated by an older javadoc version.
-link 'https://docs.oracle.com/javase/7/docs/api/'
-link 'https://docs.oracle.com/javase/8/docs/api/'
-link 'https://docs.spring.io/spring-framework/docs/5.0.9.RELEASE/javadoc-api/'
-link 'https://docs.spring.io/spring-security/site/docs/5.0.9.RELEASE/api/'
There aren't any issues if I use jdk 8. But jdk 8 will be EOL soon, so it would be nice if we could add support for jdk 11 there as well.
The text was updated successfully, but these errors were encountered: