Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error occurs when pom.xml of target project use @{argLine} instead of ${argLine} #187

Open
NDR0216 opened this issue Oct 27, 2023 · 0 comments

Comments

@NDR0216
Copy link

NDR0216 commented Oct 27, 2023

Description

When using the NonDex tool on several projects, I faced the error below from time to time

[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 1.
[ERROR] Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?

Moreover, I found that if I replaced @{argLine} with ${argLine} in pom.xml, the error was resolved

Reproduce step

  • Test Environment

    Apache Maven: 3.6.3
    Java: 11.0.20.1
    OS: Ubuntu 20.04.6 LTS
    Linux kernel: 5.4.0-164-generic

mvn -pl . edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.hubspot.jinjava.EagerTest#itHandlesImportInDeferredIf

Possible Root cause

I think the problem is caused by the time when property replacement occurs. I found a FAQ that might related to the root cause, and I quoted and linked it below.

Maven does property replacement for
${...}
values in pom.xml before any plugin is run. So Surefire would never see the place-holders in its argLine property.
Since the Version 2.17 using an alternate syntax for these properties,
@{...}
allows late replacement of properties when the plugin is executed, so properties that have been modified by other plugins will be picked up correctly.

from https://maven.apache.org/surefire/maven-surefire-plugin/faq.html#late-property-evaluation

FYI, in the example of jinjava, the first bad commit is 0e167de44a3bab111c62b49e1b8304d09e4903b5. <argLine>@{argLine} ${basepom.test.add.opens}</argLine> has been added to the pom.xml

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

No branches or pull requests

1 participant