[GRADLE-3169] Javadoc task "broken" in 2.1? Created: 15/Sep/14 Updated: 26/Nov/14 Resolved: 25/Nov/14 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Task | ||
Reporter: | Gradle Forums | Assignee: | Gary Hale |
Resolution: | Not A Bug | Votes: | 0 |
Description |
Gant javadoc task works fine in Gradle 2.0 but fails using 2.1. I cannot see anything in the release notes that would imply build gradle changes were required.
The "generated javadoc options" file contains: -author |
Comments |
Comment by Gradle Forums [ 15/Sep/14 ] |
I can reproduce the behavior with the Gant project switching between 2.0 and 2.1. I'll open an issue and investigate. In the meantime, I was able to work around the problem by setting the overview to an absolute path: javadoc { |
Comment by Dr. Gernot Starke [ 22/Nov/14 ] |
This problem also occurs in Groovy-projects without java classes... Workaround: create a public Java class with non-empty javadoc: /**
and put this in src/main/java... |
Comment by Gary Hale [ 25/Nov/14 ] |
Prior to 2.1 the working directory for the javadoc process was set to the root project directory, which was incorrect. This was fixed in 2.1 so that the working directory would be set to the project directory instead, which is correct. This difference was not an issue for single project builds, but did affect multi-project builds. The Gant build was injecting the javadoc configuration into its subprojects setting the overview to "overview.html" (relative to the root project) which happened to work properly with the working dir set to the root project directory. When this fix was made in 2.1, it was then looking for the file relative to each subproject directory instead, which is what caused the breakage. The "workaround" above is actually the proper configuration. Relative paths for the javadoc configuration will be resolved relative to the project directory. Referencing files outside of that directory need to either be specified with an absolute path or with an appropriate relative path (e.g. "../overview.html"). |
Comment by Dr. Gernot Starke [ 26/Nov/14 ] |
but... javadoc task does not work for simple groovy (multi-)projects... (when there is no public java class... groovy classes don't count...) |
Comment by Gary Hale [ 26/Nov/14 ] |
This sounds like a separate issue. Can you start a "problem" thread on the forums? We can look into it from there. Please describe your scenario (e.g. when you say you must create a public java class, does that mean you have non-public classes that you're generating javadocs for?). Include the Gradle version where the error first appeared as well as any error messages and stacktraces. |