-
Notifications
You must be signed in to change notification settings - Fork 94
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
[MJAVADOC-329] Allow generation of empty javadoc JARs #65
Open
jfallows
wants to merge
2
commits into
apache:master
Choose a base branch
from
jfallows:feature/mjavadoc-329
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add generateIfEmpty (default false) to javadoc:jar goal Add testGenerateIfEmpty (default false) to javadoc:test-jar goal
Add unit test for javadoc:jar generateIfEmpty
elharo
changed the title
[MJAVADOC-329] - Allow generation of empty javadoc JARs
[MJAVADOC-329] Allow generation of empty javadoc JARs
Jul 9, 2023
elharo
reviewed
Jul 9, 2023
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.
jonenst
added a commit
to powsybl/powsybl-math-native
that referenced
this pull request
Aug 31, 2023
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 ??
jonenst
added a commit
to powsybl/powsybl-math-native
that referenced
this pull request
Aug 31, 2023
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 <jon.harper87@gmail.com>
that would be a useful feature |
I think there is a potential better way to solve this. Some plugins have a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
generateIfEmpty
property tojavadoc:jar
goal, defaulting tofalse
for backwards compatibility.Add
testGenerateIfEmpty
property tojavadoc:test-jar
goal for consistency, defaulting tofalse
for 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-XXX
with 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-its
to 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.