Skip to content

Chore/frontend maven plugin#10

Merged
vzakharchenko merged 3 commits into
mainfrom
chore/frontend-maven-plugin
May 19, 2026
Merged

Chore/frontend maven plugin#10
vzakharchenko merged 3 commits into
mainfrom
chore/frontend-maven-plugin

Conversation

@vzakharchenko
Copy link
Copy Markdown
Member

No description provided.

vzakharchenko and others added 3 commits May 19, 2026 22:32
Migrates the npm build of the sample frontend from exec-maven-plugin
to com.github.eirslett:frontend-maven-plugin so node + npm are
downloaded, pinned, and run by Maven itself. The plugin handles
platform detection, so the dedicated <npm.executable> property and the
'platform-windows' profile in the parent sample pom drop out.

Sample parent pom (examples/.../pom.xml):
- Drop <npm.executable> property and the platform-windows profile.
- Add <frontend-maven-plugin.version>, <node.version>, <npm.version>.

Frontend pom (frontend/pom.xml):
- Replace exec-maven-plugin/npm-build with four frontend-maven-plugin
  executions: install-node-and-npm (validate), npm install (initialize),
  npm run build (generate-resources), and npm-upgrade-deps with
  <phase>none</phase> — only invoked via explicit
  `mvn frontend:npm@npm-upgrade-deps` from scripts/update-dependencies.sh.
- Cache node/npm under target/ so `mvn clean` keeps the workspace tidy.

Frontend package.json:
- Add npm-check-updates ^17 to devDependencies.
- Add `upgrade-deps` script: `ncu -u --dep prod,dev,peer && npm install`.
- package-lock.json is regenerated to match.

scripts/update-dependencies.sh:
- Replace the ad-hoc `cd ... && ncu -u && npm i && cd ...` block with
  a run_npm_upgrade_deps helper that invokes
  `mvn -f .../frontend/pom.xml com.github.eirslett:frontend-maven-plugin:npm@npm-upgrade-deps`.
- Honour --dry-run for the frontend leg too (prints the manual command
  instead of mutating anything).
- Drop the implicit `cd` chain in favour of REPO_ROOT-anchored paths.

Verified end-to-end: `mvn -pl frontend initialize` downloads node 22.11.0
+ npm 10.9.0 into target/, runs `npm install`, syncs the lockfile, and
the upgrade-deps script is reachable via the documented goal coordinate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Node 24.x is the current LTS line (codename Krypton); switching the
sample frontend onto it brings npm 11.12.1 (bundled) and keeps
contributors aligned with what nodejs.org marks as Active LTS rather
than the previous Maintenance LTS series.

Also restores line 29 of the parent sample pom, which had a stray
'yjlf' typed in front of <java.version>21</java.version> — the file
would not parse as XML; this just removes the literal characters and
leaves the property intact.

Verified locally: `mvn -pl frontend validate` downloads node v24.15.0
into target/node and `mvn -pl frontend initialize` runs npm install
cleanly (0 vulnerabilities, lockfile unchanged because the listed
dependencies did not move).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
npm-check-updates released several major versions since the original
pin. Move to ^22 (current major) to pick up the latest reporting and
bug fixes; lockfile is regenerated against the new version.

The dev-only dependency is invoked indirectly through
`npm run upgrade-deps` (added in the previous commit) and via
scripts/update-dependencies.sh -> mvn frontend:npm@npm-upgrade-deps,
so consumers see no behavioural change beyond the upgraded tool.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vzakharchenko vzakharchenko enabled auto-merge May 19, 2026 19:39
@sonarqubecloud
Copy link
Copy Markdown

@qltysh
Copy link
Copy Markdown

qltysh Bot commented May 19, 2026

Qlty


Coverage Impact

This PR will not change total coverage.

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@vzakharchenko vzakharchenko merged commit 58a5818 into main May 19, 2026
8 checks passed
@vzakharchenko vzakharchenko deleted the chore/frontend-maven-plugin branch May 19, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant