spring-projects / spring-projects/spring-tools

The run command of the Spring Apps explorer has a different behaviour than the command line

Open
#1,586 7 comments 0 reactions 2 assignees View on GitHub

@BoykoAlex is already working on this.

Since Dec 12, 2025.

status: needs-discussion type: bug
Dominant language
Java
Stars
983
Forks
240
Avg merge
7d 1h
Merged PRs (30d)
7

Description

Describe the bug
With the spring-boot-maven-plugin, I configured a Spring active profile "local".
It works with the command mvn spring-boot:run but it doesn't work with Spring Tools ("Spring Apps" explorer).

Environments

  • OS: Windows 11 Enterprise with WSL2 Debian 12
  • VS Code version: 1.101.2
  • Extension version 1.63.0
  • Maven 3.9.9
  • Spring Boot 3.5.3

To Reproduce
My parent pom has spring-boot-starter-parent as parent, and also defines all versions and configurations of my dependencies and plugins, and everything is up to date.
I have this profile in my parent pom :

        <profile>
            <id>LocalDebianSpring</id>
            <activation>
                <file>
                    <exists>src/main/resources/application.yml</exists>
                </file>
                <os>
                    <name>linux</name>
                    <version>regex:.*-wsl2</version>
                </os>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <configuration>
                            <profiles>
                                <profile>local</profile>
                            </profiles>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

It forces a Spring active profile named "local" when I'm working, but not on our Gitlab CI, so I automatically load dev parameters when I launch my application ( application-local.yml file, log format in Logback conf, etc.).
When I click on the "run arrow" in the "Spring Apps" explorer, this "local" active profile is not detected.
I rebuilt / reloaded the project many times, I deleted the workspace cache and reloaded VSCode, but nothing changed.

In the generated temporary argFile, I have this :

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=39667 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dspring.jmx.enabled=true -Djava.rmi.server.hostname=localhost -Dspring.application.admin.enabled=true -Dspring.boot.project.name=domain-cdv -XX:+ShowCodeDetailsInExceptionMessages -Dmanagement.endpoints.jmx.exposure.include=* -cp "... all my JAR dependencies ..."

Of course, if I use "run with profile...", it works. But the whole point is not to have to do it.

Additional context
Before, I had Maven properties imported into the application-local.yml file to force the "local" profile, but in some situations, the IDE automated rebuild didn't pick the properties correctly and the property value of the profile wasn't substituted in the file. That's why I switched to that solution, that should always work.

Expected behavior
When I click on the "run arrow" in the "Spring Apps" explorer, I should have the same behaviour as when I run mvn spring-boot:run.
-Dspring.profiles.active=local should be added automatically in the generated temporary argFile, deduced from the configuration of spring-boot-maven-plugin.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.