Skip to content

enhancement: syncronization with maven #1470

Open

Description

The use case for me is that essentially I run my testcases in maven
with surefire plugin.
Only if something goes wrong I switch to the test runner to analyze the details.
Then I switch back.

Currently, I have to configure both, the test runner in settings, and maven in the pom.
It would be some help if I could use the variables available in maven pom.
At least the ones available for maven projects,
better in addition those defined in the properties section in the pom.
Even better if I just can use the config of the surefire plugin.

Even helpful it would be if the settings in both worlds are comparable.
So I miss a way to include and exclude tests in test runner as provided by the surefire plugin.

Concrete suggestion: setting to syncronize with surefire

"java.test.conig": {
  "syncSurefire": "true" % with default false
}

Activity

  1. jdneo commented on Aug 16, 2022

    @jdneo
    Member

    Thank you for your feedback.

    So for now, what kind of configurations you are using in java.test.conig setting?

  2. github-actions commented on Nov 12, 2025

    @github-actions

    Hi Ernst Reissner (@Reissner), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    Current Status

    There is no built-in way to automatically read Maven Surefire settings (properties or include/exclude patterns) from your pom into VS Code’s Java Test Runner. You must manually mirror any configurations in your settings.json.

    Workarounds

    • Use the java.test.config settings to specify include/exclude patterns. For example:
      "java.test.config": {
        "include": ["**/*Test.java"],
        "exclude": ["**/integration/**"]
      }
    • Leverage the default property of a test configuration to avoid repeatedly selecting the same config when you hit Run/Debug (see below).

    References

    Other references with low confidence

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

  3. covenant-17 commented on Aug 21, 2026

    @covenant-17

    Hello! I ran into a similar problem and ended up making a small extension for it.

    It watches Maven Surefire/Failsafe reports and shows the results in VS Code, so Maven stays the actual test runner.

    GitHub: https://github.com/covenant-17/maven-test-explorer-bridge
    VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=covenant-17.maven-test-explorer-bridge

    It's a slightly different approach from syncing Java Test Runner with Surefire, but maybe it could be useful for your case too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions