VSCode Language Support for Java keeps unsetting Maven .settingsorg.eclipse.m2e.core.prefs activeProfiles - Stack Overflow

admin2025-04-16  2

I work on a company project using the VSCode extension Language Support for Java (TM) by Red Hat. My team uses a Maven profile called ide-build for local development skipping the Angular build (which itself is done by the running Angular watcher). This profile is important, because without it, the Maven build includes the complete Angular build which takes 20+ seconds each time a file changes.

This profile is set in the project's .settings/org.eclipse.m2e.core.prefs file. However, every time the Java Language Server is cleaned via "Java: Clean Java Language Server Workspace", the profile gets removed for...inexplicable reasons:

What I have tried:

  1. Setting the profile in Java Projects > Project Settings > Maven > Active Maven Profiles (GUI way of writing to the org.eclipse.m2e.core.prefs file). Unfortunately, this is overwritten by the Red Hat extension when cleaning the Java Language Server.
  2. Specifying the profile in .vscode/settings.json via "maven.executable.options": "-Pide-build". Regrettably, according to this GitHub issue, vscode-java ignores this setting.

If our project had only 1 or 2 of these settings files, it would still be bearable to have to manually set the active profile each time, but we have 51 total. So we are looking for a way to persist these settings without the extension silently undoing them.

转载请注明原文地址:http://www.anycun.com/QandA/1744734972a86873.html