Repository navigation
Conversation
added 3 commits
October 11, 2026 00:16
springdoc-openapi-starter-common-mcp/src/main/resources/mcp-ui is vite build output that was committed alongside the frontend sources. The tracked copy had drifted: it was last regenerated on 2026-07-12, while the frontend sources last changed on 2026-09-06 (the OAuth2 credential pre-fill fix), so a build passing -Dskip.npm=true packaged a dashboard without that fix. Before that, the assets were missing from the tree for three months while the committed index.html referenced files that did not exist. Fix the reason they drifted as well as the symptom. Build output was written into src/main/resources, a source directory, so mvn clean never removed it and a build skipping the frontend silently packaged whatever happened to be lying there. Write the assets into the module output directory instead, exclude mcp-ui/** from src/main/resources so a stale copy cannot be packaged, and let mvn clean drop the old copy in the source tree. Every build that runs the frontend step now produces assets matching the sources. Published artifacts were already unaffected: the release and snapshot pipelines pass -Pci precisely so that the frontend is built, and the released jar is built from a fresh checkout. Record the behaviour in CONTRIBUTING, including that -Dskip.npm=true reuses the build directory as-is rather than producing a guaranteed-empty one.
The working-with-the-code guide still described the pre-3.x project layout and toolchain: - the IntelliJ import step pointed at a root build.gradle, but the project is a Maven build with a root pom.xml, and there is no Gradle build to open; - the build section claimed JDK 1.8 or above, while the project requires the JDK 21 that CI uses; - the build command was shown as ./mvn install, but there is no mvn wrapper script in the repository root, so the command does not run as written. Fixes springdoc#3375
The dashboard assets are no longer tracked, so a build that skips the frontend step packages a jar without the UI and with no other symptom: the application still starts and /api/mcp-admin/** still works, only the dashboard assets 404. Add an enforcer rule to springdoc-openapi-starter-common-mcp requiring the generated mcp-ui/index.html to exist. It is declared in the project rather than in a workflow, so it covers every path that builds the artifact, including release:perform, which builds in its own target/checkout where a workflow-level path check could not gate the deploy. The rule is skipped when skip.npm is set, so -Dskip.npm=true keeps working as the documented way to build without Node. release.yml additionally forces -Dskip.npm=false into the release build. The root pom records that a profile change once deactivated the activeByDefault ci profile and silently skipped the npm frontend build, and that is exactly the release:perform path; pinning the property means a published release can no longer lose the dashboard without the build failing first.
This branch has not been deployed
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.
springdoc-openapi-starter-common-mcp/src/main/resources/mcp-ui/is vite build output. It wascommitted next to the sources, and it has drifted from them repeatedly. This stops tracking it and
fixes why it drifted.
The tracked copy keeps drifting
fa4114d577e649be61index.htmlwas updated to referenceindex-CscgqDf2.js/index-Cq1GlPUU.css, but those files were not added — the previous pair was deleted insteadmcp-ui/assetsabsent from the tree entirely (verified at9cc88cbab, 2026-06-21). The committedindex.htmlpointed at files that do not exist, so a build skipping the frontend produced a dashboard whose JS and CSS both 404b50ab9c1f354c98cbaRebuilding the sources as of
354c98cba^reproduces the tracked blob byte for byte:assets/index-*.js354c98cba^93700D36C967EBB7…93700D36C967EBB7…760D51C74EF97071…Why it drifted
The assets were generated into
src/main/resources, a source directory. So:mvn cleannever removed them — the module's clean plugin only addssrc/main/frontend/node_modulesto the default
target/deletion, and the generated files live outsidetarget/;-Dskip.npm=truetherefore packaged whatever happened to be lying there, with nosignal that it was stale;
stale copy would sit in the working tree invisible to
git status.Changes
build:generate the assets into the module output directory(
target/classes/mcp-ui) instead of the source tree, excludemcp-ui/**fromsrc/main/resourcesso a leftover copy can never be packaged in place of freshly built assets,drop the old copy on
mvn clean, and stop tracking the committed files.vite.config.tstakes the output directory fromMCP_UI_OUT_DIRwhen the Maven build sets it,and keeps writing next to the sources for a standalone
npm run build.docs:correct three outdated statements inCONTRIBUTING.adoc(build.gradle→pom.xml,JDK 1.8 → 21,
./mvn install→mvn install), and replace the dashboard note with what the buildactually does. Fixes Outdated project import and build instructions in CONTRIBUTING.adoc #3375.
build:fail the build when the assets are missing, in two places:springdoc-openapi-starter-common-mcprequiring the generatedmcp-ui/index.htmlto exist. It is declared in the project rather than in a workflow, so itcovers every path that builds the artifact — including
release:perform, which builds in itsown
target/checkout. A workflow-level path check could not gate that deploy: the release stepruns after the artifacts have been published (
autoPublishistrueandwaitUntilispublished), so it would only ever be a detector. The rule is skipped whenskip.npmis set,so
-Dskip.npm=truekeeps working.release.ymlforces-Dskip.npm=falseinto the release build via-Darguments. The rootpom records that a profile change once deactivated the activeByDefault
ciprofile and silentlyskipped the npm frontend build — exactly the
release:performpath thatreleaseProfilesguards. Pinning the property means a published release cannot lose the dashboard without the
build failing first.
What this does and does not guarantee
release.ymlandsnapshot.ymlbuild the frontend (-Pci, plus the forced-Dskip.npm=falseabove), and thereleased jar is built from a fresh checkout of the tag.
mvn clean ... -Dskip.npm=truenow deterministically produces a jar with no dashboard, whichserves HTTP 404 for the UI while
/api/mcp-admin/**is unaffected.mvn ... -Dskip.npm=truewithoutcleanstill reuses whatever is intarget/classes/mcp-uifrom an earlier build. That is ordinary Maven behaviour for a skipped step, it only affects local
jars, and
CONTRIBUTING.adocnow says so explicitly instead of claiming otherwise.Verification
mvn clean package(frontend enabled)src/main/resources/mcp-uideleted by clean and not recreated; assets land intarget/classes/mcp-ui;RequireFilesExist passed; jar contains the dashboard whose JS hashes to760D51C74EF97071…mvn clean package -Dskip.npm=trueSkipping Rule Enforcement.· jar has nomcp-uientry at allsrc/main/resources/mcp-ui/index.html+package -Dskip.npm=true(no clean)mcp-uientry — the resource exclusion holds, a source-tree copy is never packagedtarget/classes+enforcer:enforce@… -Dskip.npm=falseRequireFilesExist failed, listing the missing fileclean installBUILD SUCCESS, 5 of 5 modulesNotes
spring-boot-3. That line (2.9.2-SNAPSHOT) has no MCP module at all — nopath in its tree contains
mcp— so there is nothing to untrack there. Only thedocs:commitapplies to that line, and it does: that branch's
CONTRIBUTING.adochas the same three stalestatements.