Skip to content

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

@NDR0216

Description

@NDR0216

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions