spring-projects / sts4

The next generation of tooling for Spring Boot, including support for Cloud Foundry manifest files, Concourse CI pipeline definitions, BOSH deployment manifests, and more... - Available for Eclipse, Visual Studio Code, and Theia
https://spring.io/tools
Eclipse Public License 1.0
882 stars 206 forks source link

@{argLine} is not recognized in the "VM arguments" of JUnit "Run configuration" #1417

Closed psybases closed 4 days ago

psybases commented 4 days ago

Describe the bug Run configuration for JUnit tests, copies automatically the configuration from pom.xml plugin "maven-surefire-plugin" to "VM arguments". But if the configuration contains "@{argLine}", (as described at https://maven.apache.org/surefire-archives/surefire-3.2.2/maven-surefire-plugin/test-mojo.html#argline) the Junit execution fails with the following message Error: could not open `{argLine}'

To Reproduce Have a pom.xml with a maven-surefire-plugin configuration containing @{argLine} as shown in the Sample. Right click on a JUnit tests file and click "Run As -> JUnit Test". It will add automatically the following "VM arguments" to the JUnit "Run Configurations" for the given test. -ea @{argLine} -javaagent:.......

Sample

                 <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.plugin.version}</version>
                    <configuration>
                        <testFailureIgnore>false</testFailureIgnore>
                        <useSystemClassLoader>true</useSystemClassLoader>
                        <argLine>@{argLine} -javaagent:....</argLine>
                      ...
                    </configuration>
                </plugin>
martinlippert commented 4 days ago

This is most likely something that belongs to the m2e project (the Maven integration for Eclipse) and should therefore reported here: https://github.com/eclipse-m2e/m2e-core

psybases commented 4 days ago

ok thanks @martinlippert, indeed it is already addressed in this issue: https://github.com/eclipse-m2e/m2e-core/issues/1824