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

Fix Javadoc JAR generation #246

Merged
merged 1 commit into from
Sep 20, 2022
Merged

Conversation

Stephan202
Copy link
Member

@Stephan202 Stephan202 commented Sep 19, 2022

Suggested commit message:

Fix Javadoc JAR generation (#246)

For performance reasons, the Javadoc JARs are not generated when executing `mvn
install`. They are generally only compiled when running `mvn release:perform`,
as part of the `release` Maven profile.

The downside of this setup is that Javadoc generation issues may not be caught
until release time. This change resolves such an issue. To prevent future
regressions, Javadoc generation is now also performed by the GitHub Actions
build workflow.

While there, drop the deprecated `useReleaseProfile` configuration setting of
the javadoc-maven-plugin, as its value matches the default.

For performance reasons the Javadoc JARs are not generated when
executing `mvn install`. They are generally only compiled when running
`mvn release:perform`, as part of the `release` Maven profile.

The downside of this setup is that Javadoc generation issues may not be
caught until release time. This change resolves such an issue. To
prevent future regressions Javadoc generation is now also performed by
the GitHub Actions build workflow.

While there, drop the deprecated `useReleaseProfile` configuration
setting of the javadoc-maven-plugin, as its value matches the default.
@Stephan202 Stephan202 added this to the 0.3.0 milestone Sep 19, 2022
@rickie rickie requested a review from Badbond September 19, 2022 20:22
Copy link
Member Author

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the goal were faster I would have preferred to just execute javadoc:jar as part of a regular build, but at 7+ seconds that's hard to justify. There does not seem to be a jar-no-fork-style alternative.

Comment on lines +991 to +997
<additionalJOptions>
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</additionalJOption>
</additionalJOptions>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very happy that we have to duplicate this once more, but I found no way to deduplicate this between the maven-compiler-plugin and maven-javadoc-plugin.

Comment on lines +31 to +32
- name: Build project against vanilla Error Prone, compile Javadoc
run: mvn -T1C install javadoc:jar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add another plugin execution to the release profile then we should move the maven-gpg-plugin execution to a secondary release profile and use -Prelease rather than javadoc:jar here, but I suppose that for now this'll do. (But it isn't strictly correct.)

@rickie rickie added the chore A task not related to code (build, formatting, process, ...) label Sep 20, 2022
Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GHA fix is good enough for now.

Verified that it didn't work, but now works locally 😄.

Copy link
Member

@Badbond Badbond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanations offline. I agree with the expediency and making sure this step of the (currently manual) release process should just work and that this is nice to validate for now. In the future, once we go automated releases, it might indeed be nice to revisit this together with the profiles.

Updated the suggested commit message slightly (which we've not collaborately updated again).

@Stephan202 Stephan202 merged commit ae7068f into master Sep 20, 2022
@Stephan202 Stephan202 deleted the sschroevers/fix-javadoc-generation branch September 20, 2022 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A task not related to code (build, formatting, process, ...)
Development

Successfully merging this pull request may close these issues.

3 participants