Generate real javadoc and sources Maven artifacts for embedded distributions (#24278)#26099
Open
renatsaf wants to merge 1 commit into
Open
Generate real javadoc and sources Maven artifacts for embedded distributions (#24278)#26099renatsaf wants to merge 1 commit into
renatsaf wants to merge 1 commit into
Conversation
The glassfish-embedded-all and glassfish-embedded-web modules published an empty javadoc JAR (fabricated by a maven-jar-plugin "create-empty-javadoc-jar" hack) and an empty sources JAR (from the inherited 'source' profile, since these modules have no src/main/java). As a result javadoc.io shows nothing and IDEs cannot attach sources. In the oss-release profile, collect the sources JARs of all bundled modules into a single source tree (maven-dependency-plugin unpack-dependencies with the sources classifier, excluding module-info.java) and build real javadoc and sources JARs from it. The empty attach-sources execution is disabled in favour of the aggregated sources JAR. Issue eclipse-ee4j#24278 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or 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
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.
Problem
The
glassfish-embedded-allandglassfish-embedded-webartifacts on Maven Central ship a javadoc JAR and a sources JAR that are empty:maven-jar-plugincreate-empty-javadoc-jarhack pointing at a never-populated directory;sourceprofile, but these modules have nosrc/main/java, so it only contains the POM.As a result no Javadoc is published at javadoc.io (so the glassfish.org site cannot link to it), and IDEs cannot attach sources. See #24278.
Change
In the
oss-releaseprofile of both embedded modules:maven-dependency-plugin:unpack-dependencies(sources classifier,failOnMissingClassifierArtifact=falsesince not every third-party dependency publishes sources,module-info.javaexcluded so javac does not switch into module mode).maven-javadoc-plugin(sourcepath= collected sources, best-effort:doclint=none,failOnError/Warnings=false, offline-link detection off).attach-sourcesexecution so only onesourcesartifact is attached.The dependency classes are already on the module's compile/runtime classpath, so javadoc resolves the bundled APIs.
Verification
help:effective-pom -P oss-release,sourceconfirms the new executions are wired, the inheritedattach-sourcesis overridden to phasenone, and exactly onesources-classifier artifact is attached (no duplicate-classifier conflict).maven-javadoc-pluginproduced a complete, cross-linked Javadoc (unifiedindex.html), confirming the approach generates non-empty output when the dependency classes are on the classpath.Full content is produced by the release reactor build (where each component's sources JAR is built with the
oss-release/sourceprofiles).Notes
The Full and Web distributions (
distributions/glassfish,distributions/web,nucleus/distributions) still ship empty/missing javadoc & sources artifacts; they additionally skip javadoc and are zip-assembly modules, so they are left for a follow-up.🤖 Generated with Claude Code