Skip to content

Java plugin rebuilds project code everytime i instruct maven to compile #4100

Open

Description

@palminha

I have a java/maven/spring project.

The IDE is showing the JAVA build option in the bottom bar... it seems it using the JAVA plugin to build the project

Image

when i try to build my project using maven, the JAVA tries to rebuild in parallel and i get a lot of problems with the compilation

Image

Activity

  1. rgrunber commented on Jul 4, 2025

    @rgrunber
    Member

    What happens if you add the setting "java.autobuild.enabled": false ? Does that solve the build issues ? It might be that your Maven build makes certain modifications that cause the Java support to detect certain changes that then trigger the autobuild. With this setting you would have to manually trigger the rebuild but may be worth it if it solves the conflict.

  2. palminha commented on Jul 5, 2025

    @palminha
    Author

    What happens if you add the setting "java.autobuild.enabled": false ? Does that solve the build issues ? It might be that your Maven build makes certain modifications that cause the Java support to detect certain changes that then trigger the autobuild. With this setting you would have to manually trigger the rebuild but may be worth it if it solves the conflict.

    @rgrunber, that's a good mitigation, thanks. However, I won't be able to access the "problems" tab, or other functional features, that it seems it requires the java plugin...

    Returning to my original point: resolve the issue with Maven-Java not functioning correctly.

  3. palminha commented on Jul 5, 2025

    @palminha
    Author

    "java.autobuild.enabled": false doesn't block the code to be built by java plugin when i open vscode

  4. rgrunber commented on Jul 7, 2025

    @rgrunber
    Member

    What do you mean by accessing the problems tab ? Even if you disabled auto-build, you can still manually call Java: Rebuild Projects or Java: Force Java Compilation to have the problems view populated with issues. Is that what you meant ?

  5. palminha commented on Jul 8, 2025

    @palminha
    Author

    What do you mean by accessing the problems tab ? Even if you disabled auto-build, you can still manually call Java: Rebuild Projects or Java: Force Java Compilation to have the problems view populated with issues. Is that what you meant ?

    If i turn "java.autobuild.enabled": false and build the project using maven (manually select it), the problems view is not populated with results

  6. self-assigned this
    on Jul 9, 2025
  7. rgrunber commented on Jul 15, 2025

    @rgrunber
    Member

    Would you be able to share the project ? Even if you could only share the project without the sources, and could mention the kind of problems that don't get reflected in the problems view, would help.

  8. palminha commented on Jul 16, 2025

    @palminha
    Author

    Would you be able to share the project ? Even if you could only share the project without the sources, and could mention the kind of problems that don't get reflected in the problems view, would help.

    @rgrunber thanks for following up... I have open a separate topic about that specific issue: #4117

  9. rgrunber commented on Jul 16, 2025

    @rgrunber
    Member

    If this particular issue now remains about a conflict between the Java VS Code extension and the calling of a build tool from commandline (or some other way), then this seems very similar to redhat-developer/vscode-quarkus#999 . That one was about using the Quarkus tooling & Java extension ,but the idea is the same. Running a build command (even within the terminal of VS Code) while the Java extension is set to autobuild can cause conflicts.

  10. palminha commented on Jul 16, 2025

    @palminha
    Author

    If this particular issue now remains about a conflict between the Java VS Code extension and the calling of a build tool from commandline (or some other way), then this seems very similar to redhat-developer/vscode-quarkus#999 . That one was about using the Quarkus tooling & Java extension ,but the idea is the same. Running a build command (even within the terminal of VS Code) while the Java extension is set to autobuild can cause conflicts.

    @rgrunber the case here in #4117 is not related to autbuild since I disabled it following your initial suggestion ("java.autobuild.enabled": false ! Thanks for the tip!

    The question is also not related to running a specific command line tool... as you can see in #4117 i trigger the build using maven, and I expect the JAVA results are properly updated ("java.import.maven.enabled": true)

  11. tinhtran19 commented on Aug 6, 2025

    @tinhtran19

    Last time I try to exclude in watch and it works can you try @palminha
    "files.watcherExclude": {
    "/node_modules/": true,
    "/target/": true,
    "/build/": true,
    "/.git/": true,
    "/.idea/": true
    },

  12. maroony commented on Aug 29, 2025

    @maroony

    I also face this problem now. It was working fine for months. But now maven and and this Java-Plugin fighting against each other. I'm aware, that maven builds in a (VS-Code-) terminal can couse conflicts. That's why I start my Maven builds through the Maven for Java plugin. I thought, that this stops autobuilds while maven is running? As I said, this was working fine for months.

  13. rgrunber commented on Aug 29, 2025

    @rgrunber
    Member

    @maroony , what version of vscode-java are you running ? Is it the pre-release version ? Nothing has been released since the end of July. Running the build through the "Maven for Java" plugin is just a convenient way to run it the same way that would be done in terminal/commandline.

  14. maroony commented on Aug 29, 2025

    @maroony

    @rgrunber VSCode 1.103.2, Maven for Java 0.44.0, Language support for Java 1.44.0.

  15. Maze-fr commented on Oct 20, 2025

    @Maze-fr

    I have the same issue.
    As @maroony said, it wasn't a problème a few weeks / months ago. From my perspective, it was "breaking not down", meaning that we were lucky that it was working properly.

    Right now, when launching a build with vscode-maven, then vscode-java starts to rebuild immediatly in the same time, and the Maven build fails most of the time because of that. Sometimes, even mvn clean fails, unable to delete target/ content properly...
    So, to be able to work in good conditions, I keep a settings tab, opened all the time, focused on "java.autobuild", so I activate while developing (to keep the IDE up to date) and I disable it when I need to build with Maven (ex : running tests with Cucumber and / or JaCoCo, or a mvn -U clean compile to get the latest versions of my dependencies).

    Like @palminha said, here or in another issue, all modern Java projects build with Maven / Gradle. So I'm wondering how is this possible that both vscode-java and vscode-maven teams didn't have any communication about the building process to coordinate their work in order to have a flawless integration of each other's build process.

    I use : VSCode 1.105.1 / vscode-java 1.46.0 / vscode-maven 0.44.0

  16. palminha commented on Oct 21, 2025

    @palminha
    Author

    I have the same issue. As @maroony said, it wasn't a problème a few weeks / months ago. From my perspective, it was "breaking not down", meaning that we were lucky that it was working properly.

    Right now, when launching a build with vscode-maven, then vscode-java starts to rebuild immediatly in the same time, and the Maven build fails most of the time because of that. Sometimes, even mvn clean fails, unable to delete target/ content properly... So, to be able to work in good conditions, I keep a settings tab, opened all the time, focused on "java.autobuild", so I activate while developing (to keep the IDE up to date) and I disable it when I need to build with Maven (ex : running tests with Cucumber and / or JaCoCo, or a mvn -U clean compile to get the latest versions of my dependencies).

    @maroony i disable the java build with "java.autobuild.enabled": false and i'm now only using maven and waiting for this issue to be released: microsoft/vscode-maven#1098

  17. baldimir commented on Feb 2, 2026

    @baldimir

    Hi, is there a way this would be resolved somehow, please? It still happens. It is a blocker for me to use VS Code properly with Java.

  18. palminha commented on Feb 2, 2026

    @palminha
    Author

    Hi, is there a way this would be resolved somehow, please? It still happens. It is a blocker for me to use VS Code properly with Java.

    @baldimir i turned it off with java.autobuild.enabled": false.

    If you install "maven for Java" plugin version 0.45.0, then all the build messages from maven will be reflected in the problems tab (don't upgrade the plugin)

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions