Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle should pass empty -sourcepath to javadoc (like it does for javac) #5630

Closed
tbroyer opened this issue Jun 3, 2018 · 4 comments
Closed

Comments

@tbroyer
Copy link
Contributor

tbroyer commented Jun 3, 2018

Expected Behavior

Javadoc shouldn't fail (or even warn) on source files that are not in the project (i.e. in third-party dependencies)

Current Behavior

Javadoc warns, and in some times even fails (I believe in this case it's a bug in javadoc, but still), about source files that are actually packaged in third-party dependencies (i.e. present in the classpath); specifically here com.google.gwt:gwt-user:2.8.2.

./gradlew :compat:javadoc

> Task :compat:javadoc FAILED
/…/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar(com/google/gwt/event/shared/EventBus.java):24: error: cannot access EventBus
public abstract class EventBus extends com.google.web.bindery.event.shared.EventBus implements
                                                                          ^
  bad source file: /…/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar(com/google/web/bindery/event/shared/EventBus.java)
    file does not contain class com.google.web.bindery.event.shared.EventBus
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compat:javadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/…/gwt-events/compat/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
4 actionable tasks: 3 executed, 1 up-to-date

Context

GWT libraries bundle their source files, these interfere with javadoc, the way it's currently configured.

This is actually similar to #414.

A workaround is to addStringOption("sourcepath", "") in the javadoc task.

Steps to Reproduce (for bugs)

It happened to me at some point when working on https://github.com/gwtproject/gwt-events; but it can be reproduced at gwtproject/gwt-event@b2b3704f.

Your Environment

tbroyer added a commit to gwtproject/gwt-event that referenced this issue Jun 3, 2018
tbroyer added a commit to gwtproject/gwt-window that referenced this issue Jun 3, 2018
tbroyer added a commit to gwtproject/gwt-history that referenced this issue Jun 3, 2018
tbroyer added a commit to gwtproject/gwt-places that referenced this issue Jun 4, 2018
@Glusk
Copy link

Glusk commented Apr 11, 2019

This work-around does not work with:
https://github.com/nebula-plugins/gradle-aggregate-javadocs-plugin

@tbroyer
Copy link
Contributor Author

tbroyer commented Apr 11, 2019

Just tested, and yes it does: you need to apply the workaround to all Javadoc tasks in all projects and subprojects (the aggregateJavadoc task created by the plugin in the root project, and the javadoc tasks in all subprojects, as the plugin triggers their execution)

@stale
Copy link

stale bot commented Feb 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Feb 17, 2021
@stale
Copy link

stale bot commented Mar 11, 2021

This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Gradle or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request.

@stale stale bot closed this as completed Mar 11, 2021
@wolfs wolfs closed this as not planned Won't fix, can't repro, duplicate, stale Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants