Skip to content

Define inheritable spring-boot.version property #43628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kzander91 opened this issue Dec 29, 2024 · 1 comment
Closed

Define inheritable spring-boot.version property #43628

kzander91 opened this issue Dec 29, 2024 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@kzander91
Copy link
Contributor

I sometimes have the use case of having to specify the Spring Boot version in certain places, for example when defining plugin dependencies, where the inherited dependency management doesn't work, or as an argument to scripts, or for resource filtering, etc.

Spring Boot doesn't define a property itself, so I have to define one, and since Maven doesn't allow using my property to specify the parent version, I now have two places in my pom that I need to keep in sync:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.4.1</version> <!-- Can't use property here, must specify version explicitly, must be kept in sync with my property. -->
    <relativePath/>
  </parent>

  <properties>
    <spring-boot.version>3.4.1</spring-boot.version> <!-- must be kept in sync with parent version -->
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>some.group</groupId>
        <artifactId>some.plugin.artifact</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</artifactId>
            <version>${spring-boot.version}</version> <!-- Must specify version, because inherited dependency management doesn't apply here -->
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

</project>

Proposal: Define the Spring Boot version in a property in spring-boot-starter-parent (or spring-boot-starter-dependencies). That way I'd have to specify the Spring Boot version only for the parent.

@snicoll
Copy link
Member

snicoll commented Dec 29, 2024

This has been requested several times. See #23174 for an example.

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2024
@snicoll snicoll added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants