GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [SUREFIRE-1385] System properties defined in the Surefire and Failsafe plugin configuration should override user properties · Issue #2304 · apache/maven-surefire

[SUREFIRE-1385] System properties defined in the Surefire and Failsafe plugin configuration should override user properties #2304

New issue
Copy link
New issue
Copy link
Closed
Closed
[SUREFIRE-1385] System properties defined in the Surefire and Failsafe plugin configuration should override user properties#2304
Copy link
Assignees
kwin
Labels
enhancementNew feature or requestpriority:majorMajor loss of function
Milestone
3.4.0

Description

@jira-importer
jira-importer
opened on Jun 15, 2017
Issue body actions

Guillaume Boué opened SUREFIRE-1385 and commented

Consider a build with the following POM configuration for the Maven Failsafe Plugin:

<configuration>
  <systemPropertyVariables>
    <prop>foo</prop>
  </systemPropertyVariables>
</configuration>

When running the build with the command line mvn -Dprop=bar ..., the tests would be passed a system property with a value of bar instead of foo.

This is counter-intuitive since direct configuration of the plugin is overriden by the more general properties passed on the command line. I would have expected the closer definition in the POM to override the one passed with the CLI. Furthermore, in the case of the above sample, it would not be possible for the tests run by the Failsafe Plugin to have a system property prop with a value of foo if the build happens to already define a system property with the same name. While using a different name to avoid a clash is possible, it still doesn't make the test self-contained and consistent since anyone could run Maven with that other name and compromise the test that really relies on the system property having a value of foo.

The proposal is thus to make the systemPropertyVariables and systemPropertiesFile configuration elements of the Surefire and Failsafe Plugin take precedence over user properties passed on the command line.

Proposed commit 4de017b38b101b0b28f9fbed135eae3921b99d0d on SUREFIRE-1385 branch.


Affects: 2.20

Issue Links:

  • MASFRES-70 ITs in ASF Jenkins use wrong artifact for testing
    ("causes")
  • SUREFIRE-121 System properties set on the command line get clobbered

Remote Links:

  • GitHub Pull Request #762

0 votes, 6 watchers

Activity

  1. jira-importer commented on Jun 16, 2017

    @jira-importer
    jira-importer
    on Jun 16, 2017
    Author
    More actions

    Tibor Digana commented

    Guillaume Boué
    I think such like this request was here with feature to provide sys props in file several days ago.
    It was this month but we said that this this well suited feature in version 3.0 because of the extensions which would extend current POM configurations.
    Pls check the history in Jira.

  2. jira-importer commented on Jun 17, 2017

    @jira-importer
    jira-importer
    on Jun 17, 2017
    Author
    More actions

    Guillaume Boué commented

    I noticed SUREFIRE-1365 about loading environment variables from a file. What do you think about creating an umbrella issue for 3.0, containing all the current issues regarding properties handling as subtasks?

  3. jira-importer commented on Jun 19, 2017

    @jira-importer
    jira-importer
    on Jun 19, 2017
    Author
    More actions

    Tibor Digana commented

    Guillaume Boué
    I have assigned this issue to version 3.0.

  4. jira-importer commented on Jul 9, 2024

    @jira-importer
    jira-importer
    on Jul 9, 2024
    Author
    More actions

    Konrad Windszus commented

    I can see use cases for letting CLI properties overwrite surefire plugin system properties and vice versa. So just changing the order of precedence seems dangerous. Also the default Maven behaviour is that properties passed via CLI take precedence over properties defined in POM.

    I would rather propose to either
    a) introduce a new boolean flag for toggling the order of precedence for system properties or
    b) introduce a new parameter userPropertyVariables which explicitly overwrites the user properties from the calling Maven session

    WDYT?

  5. jira-importer commented on Jul 12, 2024

    @jira-importer
    jira-importer
    on Jul 12, 2024
    Author
    More actions

    Konrad Windszus commented

    One common issue is property maven.repo.local which is set in ASF Jenkins implicitly through https://plugins.jenkins.io/pipeline-maven/#plugin-content-usage (as CLI parameter), and cannot be overwritten afterwards (e.g. for https://maven.apache.org/shared/maven-verifier/getting-started.html used in ITs with maven-failsafe-plugin).

  6. jira-importer commented on Aug 7, 2024

    @jira-importer
    jira-importer
    on Aug 7, 2024
    Author
    More actions

    Konrad Windszus commented

    Fixed in 4bd36a1

  7. jira-importer commented on Aug 27, 2024

    @jira-importer
    jira-importer
    on Aug 27, 2024
    Author
    More actions

    Falko Modler commented

    FWIW, this check is a bit overzealous when using placeholders: SUREFIRE-2258

  8. jira-importer
    closed this as completedon Aug 27, 2024
  9. jira-importer
    assigned
    kwin
    on Jul 4, 2025
  10. jira-importer
    added
    enhancementNew feature or request
    priority:majorMajor loss of function
    on Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kwin
    kwin

Labels

enhancementNew feature or requestpriority:majorMajor loss of function

Type

No type

Projects

No projects

    Milestone

    • 3.4.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.