-
Notifications
You must be signed in to change notification settings - Fork 49
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
means for m2e to set system properties for some tests #548
Comments
m2e can provide own launch configuration type (like "Run as Maven Test" or something in that direction) and configure there everything based on pom files. Platform itself doesn't know anything about maven. |
Maybe I didn't explain well what is being requested. I know the Eclipse platform knows nothing about Maven. I am not requesting that the Eclipse platform know anything about Maven. I am requesting that the Eclipse platform provide some means for some other subsystem to pass it system property values to make available when running tests. Looking at the Eclipse IDE as a whole, when I open Eclipse and run a test normally (without going to some special "Run as Maven Test" menu), I expect the classpath to be correctly configured based upon my Maven POM. Does this mean the Eclipse platform knows something about Maven so that it directly retrieves the classpath from the POM? I imagine not; instead, the platform undoubtedly provides some way to configure the classpath, and m2e determines the classpath from Maven and informs the platform of this. (I'm guessing about how it works, but it's not an unreasonable assumption.) Similarly when I looking at the Eclipse IDE as a whole, when I open Eclipse and run a test normally (without going to some special "Run as Maven Test" menu), I expect the system properties that I configured in my Maven POM to be available to the unit/integration tests. (Apparently this works in IntelliJ.) Does this mean I am asking the platform to have knowledge of Maven? No, it means I am requesting that the platform provide a means for specifying per-project system properties for tests (just as it provides a means for specifying the project classpath) so that another module (in this case m2e) can configure those properties accordingly. m2e tells me they cannot do this because the plaform does not provide them this means. They requested that I file this ticket requesting the platform add that facility. |
That would be possible, but I tend to have sympathy for the suggestion. That being said, it could be implemented without any need to tell platform/JDT anything about Maven by providing some kind of hook that can modify the It is already possible to be notified about launches being created by registering a |
Another use case for this would be in PDE. |
There needs to be a means for m2e to advise the Eclipse IDE testing subsystem of system properties to make available to unit tests when run within the IDE.
Both the Maven Surefire Plugin and the Maven Failsafe Plugin provide a
<systemPropertyVariables>
as way to configure system properties that will be accessible for unit test and integration tests, respectively. See Using System Properties for an example.IntelliJ apparently (see IDEA-101185) supports
<systemPropertyVariables>
in in-IDE tests.Unfortunately Eclipse IDE ignore any
<systemPropertyVariables>
properties set in the Maven POM in these plugin configurations. In the discussion in eclipse-m2e/m2e-core#174, I was told that m2e, when in processes a Maven POM, has no way to advise Eclipse of the system properties to be used for in-IDE testing. I was asked to file a ticket here to request this capability. Otherwise, our<systemPropertyVariables>
properties are ignored in unit/integration tests and according to m2e, they have no way around this.The text was updated successfully, but these errors were encountered: