-
Notifications
You must be signed in to change notification settings - Fork 116
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
Propagation of Surefire/Failsafe plugin configuration does not correctly remove unresolvable properties #1916
Comments
I think m2e-core/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/UnitTestSupport.java Line 410 in c0014cc
|
@treilhes Is that something you could look at? |
M2E should not require POM changes. As this configuration works fine in CLI let's make it work in m2e... |
I am running into this problem on an m2e 2.7.0.20241126-1642 (within a recent STS). I've followed the advice given by the Mockito team here as recent Java versions require agents to be explicitly attached. With that configuration added to the project, all test executions in Eclipse now fail because m2e added an unexpanded I essentially have to roll back the change recommended by the Mockito team because it affects all launch configurations of the project, and they only become executable once I manually remove that argument again. The suggestion to use |
This reverts commit f6dd783. See [0] for details. Additionally, the change causes our integration builds to fail as the Mockito versions referred to by older Boot versions do not contain the necessary manifest entries. [0] eclipse-m2e/m2e-core#1916 (comment)
This reverts commit 74f4417. See [0] for details. Additionally, the change causes our integration builds to fail as the Mockito versions referred to by older Boot versions do not contain the necessary manifest entries. [0] eclipse-m2e/m2e-core#1916 (comment)
This reverts commit 003c428. See [0] for details. Additionally, the change causes our integration builds to fail as the Mockito versions referred to by older Boot versions do not contain the necessary manifest entries. [0] eclipse-m2e/m2e-core#1916 (comment)
Hello @odrotbohm By default m2e does not run any other plugin than surefire/failsafe to extract the unit test configuration as it may be too consuming. To do that you need to configure the lifecycle mapping as follow:
With this configuration you're telling m2e to run the maven-dependency-plugin during the configuration phase which include the unit test configuration generation. |
Sometimes properties are not explicitly set in the pom.xml but are rather set through some other plugins. Most prominent example is https://www.jacoco.org/jacoco/trunk/doc/prepare-agent-mojo.html#propertyName.
As this property can obviously not be resolved when extracting the surefire/failsafe plugins, all unknown placeholder inside
${...}
should just be replaced by the empty string.For example I have this configuration in my pom.xml
Usually
test.opts.coverage
is populated fromThis leads to the following error launching the auto-created JUnit configuration
Reference to undefined variable test.opts.coverage
because the VM arguments contain the unresolved${test.opts.coverage}
.This is a regression of c8bcaaa.
The text was updated successfully, but these errors were encountered: