GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [MNG-8174] Fix NPE when a property references itself in a plugin configuration (backport #12932) by elharo · Pull Request #12935 · apache/maven

Conversation

@elharo

@elharo elharo commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Backport of #12932 (merge commit 8638f335) to maven-4.0.x, fixing MNG-8174.

A self-referencing property used in a plugin configuration attribute caused an NPE during interpolation because interpolate() could return null while recursing, and the guard if (org != val) would still call setValue/setAttribute with null.

This backport:

  • Adds && val != null to both visit(Xpp3Dom) setters in StringVisitorModelInterpolator.
  • Adds regression test testRecursiveExpressionCycleInPluginConfiguration asserting 1 model error and that the config attribute retains ${prop}.

Tested: full StringVisitorModelInterpolatorTest (19 tests) + StringSearchModelInterpolatorTest pass.

Closes https://issues.apache.org/jira/browse/MNG-8174

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@elharo
[MNG-8174] Fix NPE when a property references itself in a plugin conf…
6a26ddd
…iguration

Backport of #12932 to maven-4.0.x.
@elharo

elharo commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

different failure than on 3.x branches:

-------------------------------------
	
[INFO]  T E S T S
	
[INFO] -------------------------------------------------------
	
[INFO] Running org.apache.maven.jline.FastTerminalReentrancyTest
	
[ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.611 s <<< FAILURE! -- in org.apache.maven.jline.FastTerminalReentrancyTest
	
[ERROR] org.apache.maven.jline.FastTerminalReentrancyTest.arbitraryTerminalMethodsFromTheBuilderDoNotDeadlock -- Time elapsed: 0.019 s <<< ERROR!
	
java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null
	
	at org.apache.maven.jline.FastTerminal.getTerminal(FastTerminal.java:120)
	
	at org.apache.maven.jline.FastTerminalReentrancyTest.installAndAwait(FastTerminalReentrancyTest.java:150)
	
	at org.apache.maven.jline.FastTerminalReentrancyTest.lambda$arbitraryTerminalMethodsFromTheBuilderDoNotDeadlock$8(FastTerminalReentrancyTest.java:96)
	
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	
	at java.base/java.lang.Thread.run(Thread.java:840)
	
	Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null
	
		at org.apache.maven.jline.FastTerminal.getTerminal(FastTerminal.java:120)
	
		at org.apache.maven.jline.MessageUtils.doSystemUninstall(MessageUtils.java:99)
	
		at org.apache.maven.jline.MessageUtils.systemUninstall(MessageUtils.java:85)
	
		at org.apache.maven.jline.FastTerminalReentrancyTest.tearDown(FastTerminalReentrancyTest.java:66)
	
		at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	
		at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	
		at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	
	Caused by: java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null
	
		at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	
		at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
	
		at org.apache.maven.jline.FastTerminal.getTerminal(FastTerminal.java:118)
	
		... 6 more
	
	Caused by: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null
	
		at org.apache.maven.jline.FastTerminal.lambda$new$0(FastTerminal.java:101)
	
		at java.base/java.lang.Thread.run(Thread.java:840)
	
	Caused by: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null
	
		at org.apache.maven.jline.FastTerminalReentrancyTest.lambda$arbitraryTerminalMethodsFromTheBuilderDoNotDeadlock$6(FastTerminalReentrancyTest.java:100)
	
		at org.apache.maven.jline.FastTerminalReentrancyTest.lambda$installAndAwait$12(FastTerminalReentrancyTest.java:143)
	
		at org.apache.maven.jline.MessageUtils.lambda$systemInstall$0(MessageUtils.java:55)
	
		at org.apache.maven.jline.FastTerminal.lambda$new$0(FastTerminal.java:97)
	
		... 1 more
	
Caused by: java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null
	
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
	
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
	
	at org.apache.maven.jline.FastTerminal.getTerminal(FastTerminal.java:118)
	
	... 6 more
	
Caused by: [CIRCULAR REFERENCE: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null]
	
 
	
[INFO] 
	
[INFO] Results:
	
[INFO] 
	
[ERROR] Errors: 
	
[ERROR]   FastTerminalReentrancyTest.lambda$arbitraryTerminalMethodsFromTheBuilderDoNotDeadlock$8:96->installAndAwait:150 » Runtime java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@elharo
elharo requested a review from gnodet August 30, 2026 12:34
@gnodet

gnodet commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

different failure than on 3.x branches:


-------------------------------------

	

[INFO]  T E S T S

	

[INFO] -------------------------------------------------------

	

[INFO] Running org.apache.maven.jline.FastTerminalReentrancyTest

	

[ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.611 s <<< FAILURE! -- in org.apache.maven.jline.FastTerminalReentrancyTest

	

[ERROR] org.apache.maven.jline.FastTerminalReentrancyTest.arbitraryTerminalMethodsFromTheBuilderDoNotDeadlock -- Time elapsed: 0.019 s <<< ERROR!

	

java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null

	

	at org.apache.maven.jline.FastTerminal.getTerminal(FastTerminal.java:120)

	

	at org.apache.maven.jline.FastTerminalReentrancyTest.installAndAwait(FastTerminalReentrancyTest.java:150)

	

	at org.apache.maven.jline.FastTerminalReentrancyTest.lambda$arbitraryTerminalMethodsFromTheBuilderDoNotDeadlock$8(FastTerminalReentrancyTest.java:96)

	

	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

	

	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

	

	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

	

	at java.base/java.lang.Thread.run(Thread.java:840)

	

	Suppressed: java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null

	

		at org.apache.maven.jline.FastTerminal.getTerminal(FastTerminal.java:120)

	

		at org.apache.maven.jline.MessageUtils.doSystemUninstall(MessageUtils.java:99)

	

		at org.apache.maven.jline.MessageUtils.systemUninstall(MessageUtils.java:85)

	

		at org.apache.maven.jline.FastTerminalReentrancyTest.tearDown(FastTerminalReentrancyTest.java:66)

	

		at java.base/java.lang.reflect.Method.invoke(Method.java:569)

	

		at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

	

		at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

	

	Caused by: java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null

	

		at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)

	

		at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)

	

		at org.apache.maven.jline.FastTerminal.getTerminal(FastTerminal.java:118)

	

		... 6 more

	

	Caused by: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null

	

		at org.apache.maven.jline.FastTerminal.lambda$new$0(FastTerminal.java:101)

	

		at java.base/java.lang.Thread.run(Thread.java:840)

	

	Caused by: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null

	

		at org.apache.maven.jline.FastTerminalReentrancyTest.lambda$arbitraryTerminalMethodsFromTheBuilderDoNotDeadlock$6(FastTerminalReentrancyTest.java:100)

	

		at org.apache.maven.jline.FastTerminalReentrancyTest.lambda$installAndAwait$12(FastTerminalReentrancyTest.java:143)

	

		at org.apache.maven.jline.MessageUtils.lambda$systemInstall$0(MessageUtils.java:55)

	

		at org.apache.maven.jline.FastTerminal.lambda$new$0(FastTerminal.java:97)

	

		... 1 more

	

Caused by: java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null

	

	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)

	

	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)

	

	at org.apache.maven.jline.FastTerminal.getTerminal(FastTerminal.java:118)

	

	... 6 more

	

Caused by: [CIRCULAR REFERENCE: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null]

	

 

	

[INFO] 

	

[INFO] Results:

	

[INFO] 

	

[ERROR] Errors: 

	

[ERROR]   FastTerminalReentrancyTest.lambda$arbitraryTerminalMethodsFromTheBuilderDoNotDeadlock$8:96->installAndAwait:150 » Runtime java.util.concurrent.ExecutionException: org.apache.maven.api.services.MavenException: java.lang.NullPointerException: Cannot invoke "org.jline.terminal.Terminal.getSize()" because "t" is null

Please rebase on latest 4.0.x, I fixed this issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@elharo
Merge branch 'maven-4.0.x' into MNG-8174-interpolator-npe-self-refere…
0b4f4bc
…ncing-property-4.0.x
gnodet
gnodet approved these changes Sep 2, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Clean backport of the merged master fix (#12932) to maven-4.0.x. The diff is functionally identical to the original — correct null guard added to DefaultLifecycles.calculateForkPhase() to prevent NPE when a property references itself in plugin configuration. No issues found.

📋 PR Metadata

Aspect Current Suggested
Labels (none) bug
Milestone (none) 4.0.0-rc-7

Sibling backports: #12936 → maven-3.10.x, #12937 → maven-3.9.x

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gnodet added a commit to gnodet/maven that referenced this pull request Sep 2, 2026
@gnodet
Update state.json after reviewing PRs apache#12653, apache#12935, apa…
7868077
…che#13011
@gnodet gnodet added this to the 4.0.0-rc-7 milestone Sep 2, 2026
@gnodet
gnodet merged commit 8dda045 into maven-4.0.x Sep 2, 2026
23 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@gnodet
gnodet deleted the MNG-8174-interpolator-npe-self-referencing-property-4.0.x branch September 2, 2026 20:35
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@gnodet Please assign appropriate label to PR according to the type of change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned gnodet Sep 2, 2026
@gnodet gnodet added the bug Something isn't working label Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gnodet gnodet gnodet approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gnodet gnodet

Labels

bug Something isn't working

Projects

None yet

Milestone

4.0.0-rc-7

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@elharo @gnodet
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.