Skip to content

-Dspring.profiles.active ignored when mvn spring-boot:run #1095

@kryger

Description

@kryger

Upgrading 1.0.2.RELEASE->1.1.0.RELEASE changed how passing profile to mvn spring-boot:run works, the -Dspring.profiles.active flag seems to be ignored. I created a simple project that reproduces the problem: https://github.com/kryger/bug-spring-maven-profiles

(Note that application.yml defines port=3333, application-production.yml defines port=1111)

Steps to reproduce:

  1. Check out the project - it uses 1.1.0.RELEASE
  2. mvn spring-boot:run -Dspring.profiles.active=production -> Tomcat starts on port 3333 (expected 1111)
  3. Edit pom.xml and change <version> to 1.0.2.RELEASE
  4. mvn spring-boot:run -Dspring.profiles.active=production again -> Tomcat starts on port 1111

I had a look at 1.1.0.RELEASE's release notes but couldn't find anything that would explain this change - no idea if it's a bug or a feature :).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions