-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Remove spring-boot.version property from spring-boot-dependencies #5014
Comments
👍 |
@wilkinsona I think there is a use case that was not considered before removing this property. I have a multi-module project using spring boot. In my parent pom I have a dependencies management section that excludes <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement> After upgrading I have to either hard code the version in the dependency management section or create my own property and hard code it there like this: <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
</parent>
<properties>
<spring-boot.version>1.4.0.RELEASE</spring-boot.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement> So now I have two places where I have to maintain the version of spring boot and run the risk of having mismatched versions. I understand the reason for the change is to make things less confusing but I feel like an option that just prevents someone from overriding the property or at least warns them if they do would be better. For instance, in the Even with this change you would still want to not reference the property in the spring-boot pom files so the changes that were made in this pull request are still relevant. Basically, what I'm suggesting is a read-only property that the plugin will make available so that it can be used when a project needs to reference the spring boot version. If this sounds good to you I'd be happy to open a pull request with this change. |
That sounds rather complicated to me, but I'll defer to @snicoll as he's the team's resident Maven expert. |
+1 with @wilkinsona. Either way, if you use the parent X.Y.Z you shouldn't be allowed to override X.Y.Z. I agree that your use case is a bit annoying but it's not annoying enough for us to consider reverting this, sorry. |
@snicoll, I think I have been misunderstood. I'm not suggesting reverting the change. I'm suggesting adding a feature to the maven plugin that makes a property available. It is not a property that will be used by the spring boot build at all, just generated by the plugin so that it can be referenced. To ease your concern @wilkinsona of complication it is really quite simple. This is similar to what the git-commit-id-plugin does when it makes all the git commit information available as maven properties (example). I have also done something similar in my phantomjs-maven-plugin where I set a property indicating the location of phantomjs. What I haven't confirmed is if this would actually work for my use case because I'm not sure if maven runs the initialization phase before resolving the versions in the dependency management section. I would think that it does because the initialization phase is for doing things like setting properties but I would need to try it out first. I don't want to waste my time though if it's never going to see the light of day so I just need to know if this would be something the team would be OK with pursuing. Again, not saying we should revert this change and definitely agree that a user should not be able to set this property and have that effect what version of spring boot dependencies are being pulled in. I also +1 agree with @wilkinsona on the original change. |
I got you the first time @klieber - I don't think we should do this, sorry. |
Understood. Thanks. |
It, for good reason, doesn't control the version of any Spring Boot dependencies but people assume that it will. This is confusing people. Assuming it doesn't break the release process, we should get rid of it.
See #3992 and http://stackoverflow.com/questions/34961808/maven-and-spring-boot-dependencies/34961950#34961950
The text was updated successfully, but these errors were encountered: