Skip to content

Support for Maven Toolchains in Spring Boot Maven Plugin #46446

@brunoborges

Description

@brunoborges

Currently, the Spring Boot Maven Plugin does not appear to support Maven Toolchains when executing goals like spring-boot:run.

Maven Toolchains provide a standard and flexible way to configure different JDKs for build and runtime, and they are especially helpful in CI environments or when managing multiple JDK versions locally. While the compiler and surefire plugins already support toolchains, the Spring Boot Maven Plugin seems to ignore the toolchain configuration and uses the default JDK instead.

Feature Request

Please add support for Maven Toolchains to the Spring Boot Maven Plugin, so that the configured toolchain JDK is used when:

  • Running spring-boot:run
  • Creating executable jars with spring-boot:repackage
  • Building OCI images via spring-boot:build-image
  • Any other plugin goal that relies on the JDK

Use Case / Motivation:

  • Enables consistent builds across environments, especially in CI/CD pipelines where the default JDK might not match the desired one.
  • Allows developers to use specific JDK versions for Spring Boot projects without needing to globally switch JDKs.
  • Aligns the plugin behavior with other Maven tooling that already respects toolchains.xml.

References

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