Skip to content

Option to disable m2e intercepting Runtime JRE and VM Arguments for Junit Launchers #2137

@subes

Description

@subes

Introduced in m2e 2.10.0: https://github.com/eclipse-m2e/m2e-core/blob/main/RELEASE_NOTES.md#maven-execution-jre-used-for-tests

Please add an option so that Runtime JRE and VM Arguments do not get overwritten. Currently this messes up all our newly created launchers:
Image

  • it reads jacoco properties (which only exist in a jacoco profile and are disabled per default) which are only relevant for special code coverage CI runs
  • it reads memory settings and command line arguments from maven-surefire-plugin which disable parallelization features (for some maven modules) and reduce memory consumption (on most maven modules) for CI runs. In eclipse we don't want to use any of these properties from the pom.xml.
Image - we are still compiling with Java 8 compliance but use Java 21. m2e replacing the JDK version in eclipse Junit runs breaks the junit test as it fails due to wrong class versions being used (by third party libraries requiring higher java versions) when actually using a Java9/8 JRE (it uses Java 9 in this example, because on this machine no Java 8 is installed). Instead the Junit test should be configured to "Project execution environment" which uses Java 8 compliance with a Java 21 JDK as it is supposed to (in some cases we still use Java 8, Java 11, Java 17, providing backwards compatibility to older JVMs).

The current behaviour is annoying, as we always have to manually edit newly created launchers to remove these overrides from m2e. m2e breaks our configuration which normally works fine with the eclipse defaults. Please add an option to disable these overrides for JUnit tests.

I suspect this was the intent of this settings view:
Image
But this has no effect on the Junit tests launchers. The Junit launchers are still messed up.

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