Visitar URL original
fix(maven): do not cache exec-maven-plugin:java by FrozenPandaz · Pull Request #37542 · nrwl/nx · GitHub
Skip to content

fix(maven): do not cache exec-maven-plugin:java - #37542

Merged
FrozenPandaz merged 4 commits into
masterfrom
fix/maven-exec-java-not-cacheable
Oct 21, 2026
Merged

FrozenPandaz merged 4 commits into
masterfrom
fix/maven-exec-java-not-cacheable

Conversation

@FrozenPandaz

@FrozenPandaz FrozenPandaz commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Current Behavior

The Maven analyzer decides whether a goal is cacheable with a short deny list, and everything not on it is cacheable with {projectRoot}/target as its output. exec-maven-plugin:java is not on the list, so the inferred exec:java target is cache: true.

exec:java runs an arbitrary main class. Its effects are not captured by target/, and a cache hit replays the stored terminal output without starting the program. A server started with exec:java never starts on the second run, and marking the target continuous: true in project.json is rejected until cache: false is added alongside, because Nx refuses a continuous target that is also cacheable.

Expected Behavior

exec-maven-plugin:java is in the analyzer's nonCacheable set, so the inferred exec:java target is cache: false with no inputs or outputs, the same as spring-boot-maven-plugin:run. A MojoAnalyzerTest case covers it.

The scope is deliberately exec:java only. exec:exec runs an external executable and could get the same treatment, but it is also used for one-shot build steps, so that change is left for a separate decision.

The Maven plugin version moves to 0.0.19 across the POMs and @nx/maven's pinned version, with the usual migration that updates dev.nx.maven:nx-maven-plugin in a workspace's root pom.xml.

Related Issue(s)

N/A


View Polygraph session ↗

exec:java runs an arbitrary main class, so its effects are not captured by
the target/ output the analyzer assumes. A cached hit would replay the
terminal output and never start the program, which is wrong for a server
started with exec:java and for any other side-effecting run.
@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit c22ac55
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6ad91316b496c5da3d0e8804
😎 Deploy Preview https://deploy-preview-37542--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit c22ac55

Command Status Duration Result
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 38s View ↗
nx-cloud record -- nx format:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-21 19:35:55 UTC

@polygraph-app
polygraph-app Bot marked this pull request as ready for review October 21, 2026 17:46
@polygraph-app
polygraph-app Bot requested a review from a team as a code owner October 21, 2026 17:46
@polygraph-app
polygraph-app Bot requested a review from lourw October 21, 2026 17:46
@FrozenPandaz
FrozenPandaz enabled auto-merge (squash) October 21, 2026 17:47
@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit c22ac55
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6ad913166ff49fa6c8c46930
😎 Deploy Preview https://deploy-preview-37542--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nx Cloud has identified a flaky task in your failed CI:

🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz
FrozenPandaz disabled auto-merge October 21, 2026 19:35
@FrozenPandaz
FrozenPandaz merged commit b84b2a4 into master Oct 21, 2026
21 checks passed
@FrozenPandaz
FrozenPandaz deleted the fix/maven-exec-java-not-cacheable branch October 21, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants