-
Couldn't load subscription status.
- Fork 103
[MJAVADOC-329] Allow generation of empty javadoc JARs #65
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
Conversation
Add generateIfEmpty (default false) to javadoc:jar goal Add testGenerateIfEmpty (default false) to javadoc:test-jar goal
Add unit test for javadoc:jar generateIfEmpty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can review if you resolve conflicts.
This adds a package-info.class file to the generated jar but it shouldn't be a problem This is because maven uses the jar as the input to the javadoc tool and we don't want to diverge too much from the maven way (you get problems really fast) (In theory, I guess we could generated the javadoc from target/classes instead of target/project.jar) The generated javadoc has one package with one class because: - It doesn't seem to be possible to generate an empty javadoc (no packages). - It doesn't seem to be possible to generate an empty package (no classes). references: * https://stackoverflow.com/questions/53706943/how-to-upload-an-artifact-to-maven-central-with-an-empty-javadoc-jar-or-empty-s => what we did in 1.0.0 and 1.0.1: totally empty javadoc.jar (valid for maven central upload but ugly) * https://stackoverflow.com/questions/59071851/how-to-force-a-javadoc-jar-even-though-there-is-no-public-javadoc => still produces a totally empty javadoc.jar (and big scary red errors) * https://stackoverflow.com/questions/1138390/javadoc-for-package-info-java-only => This plus excluding the class from the jar seems like the best solution for now ? promising but not yet ready: * https://issues.apache.org/jira/browse/MJAVADOC-329 apache/maven-javadoc-plugin#65 * https://bugs.openjdk.org/browse/JDK-8193107 https://hg.openjdk.org/jdk/jdk/rev/111104f1e033 empty modules are allowed, but does becoming a module work with how the native library are loaded ??
This adds a package-info.class file to the generated jar but it shouldn't be a problem This is because maven uses the jar as the input to the javadoc tool and we don't want to diverge too much from the maven way (you get problems really fast) (In theory, I guess we could generated the javadoc from target/classes instead of target/project.jar) The generated javadoc has one package with one class because: - It doesn't seem to be possible to generate an empty javadoc (no packages). - It doesn't seem to be possible to generate an empty package (no classes). references: * https://stackoverflow.com/questions/53706943/how-to-upload-an-artifact-to-maven-central-with-an-empty-javadoc-jar-or-empty-s => what we did in 1.0.0 and 1.0.1: totally empty javadoc.jar (valid for maven central upload but ugly) * https://stackoverflow.com/questions/59071851/how-to-force-a-javadoc-jar-even-though-there-is-no-public-javadoc => still produces a totally empty javadoc.jar (and big scary red errors) * https://stackoverflow.com/questions/1138390/javadoc-for-package-info-java-only => This plus excluding the class from the jar seems like the best solution for now ? promising but not yet ready: * https://issues.apache.org/jira/browse/MJAVADOC-329 apache/maven-javadoc-plugin#65 * https://bugs.openjdk.org/browse/JDK-8193107 https://hg.openjdk.org/jdk/jdk/rev/111104f1e033 empty modules are allowed, but does becoming a module work with how the native library are loaded ?? Signed-off-by: HARPER Jon <[email protected]>
|
that would be a useful feature |
|
I think there is a potential better way to solve this. Some plugins have a |
|
closing in favor of #331 |
|
Resolve #640 |
Add
generateIfEmptyproperty tojavadoc:jargoal, defaulting tofalsefor backwards compatibility.Add
testGenerateIfEmptyproperty tojavadoc:test-jargoal for consistency, defaulting tofalsefor backwards compatibility.where no non-internal classes exist, therefore no public Javadoc is required, yet Maven Central requires inclusion of a Javadoc JAR during deployment.
This now simplifies to
Integration tests passed successfully.
As ASF Committer
jfallows,Checklist
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[MJAVADOC-XXX] - Fixes bug in ApproximateQuantiles,where you replace
MJAVADOC-XXXwith the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean verify -Prun-itsto make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.