-
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
systemPropertyVariables ignored #174
Comments
The last comment on that issue unfortunately tends to be misleading. It was intend as general statement that m2e issues are moved to github. However, as stated in comment 1 of the linked bug, executing a Test via As a workaround you can add the desired system-properties to the JUnit launch-configuration in the |
I would like to revisit this issue. On SLF4J-592 we're discussing the best approach for specifying a logging provider to be used only in Maven tests without interfering with the main application logging provider (if any). The idea is to configure a logging provider for tests in a parent POM with The simplest and elegant solution we're converging on so far is to simply have a system property e.g. Whether this works depends on whether it is possible to specify a system property for Maven tests. Both the Maven Surefire Plugin and the Maven Failsafe Plugin provide a I've tested this in Maven 3.9.1 with Surefire.
Unfortunately when I manually run a JUnit test in the Eclipse IDE, the unit test does not see the system property @HannesWell you indicated that running unit tests in the Eclipse IDE is "not connected to the Maven configuration at all". But m2e examines the POM(s) when updating the projects (automatically and with If there are no plans to recognize |
It would appear this is supported in IntelliJ; see IDEA-101185. (See comments and pull requests on that ticket.) |
@garretwilson I don't think this is possible as m2e does not can configure eclipse junit runs triggered by the UI, but you can run the test once and then edit the resulting runconfiguration and add any java option you like. As an alternative, you need to ask JDT project for a way to have a project configurable "test properties" that are considered and can be set by m2e beforehands.
Without knowing the details, I would have choose a quite different approach:
|
I'd like to not get off topic on this ticket. We welcome your input on the SLF4J-592 for alternate ideas to address that use case. As to your suggestion, the idea here was to configure this in a parent POM, and without going into its qualities in general, your |
Well you can have a module If you insist of the system properties, as said m2e needs support from JDT here as we are not in charge of the test-run in any way. |
Done; see eclipse-jdt/eclipse.jdt.debug#548 . |
OK, but what specifically would this |
It would contain the |
I'm curious—what facility does m2e currently use to inform the Eclipse in-IDE testing platform of the test classpath specified by Maven for a project? (I'm guessing a facility for specifying system properties, which I've requested in eclipse-jdt/eclipse.jdt.debug#548 , would be analogous.) |
Feel free to copy a link and/or mentioned alternatives there but I don't have a JIRA account yet to participate directly.
JDT has an extension point where extenders can supply a classpath container, if you import a maven project you will see an additional "Maven Dependencies" in the project and can expand it to see the items contributed to Eclipse JDT, an item can additionally be flagged as being "test". This is the used by the compiler, by test runs, and probably others neither m2e nor jdt knows about so it is not dedicated to a single usage. |
it looks like this is an ancient issue and despite it claiming here it was transferred, I couldn't find any ref to it here.
ref https://bugs.eclipse.org/bugs/show_bug.cgi?id=388683
the maven failsafe/surefire
<systemPropertyVariables>
properties are ignored.The text was updated successfully, but these errors were encountered: