You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl Heinz Marbaise (JIRA)" <ji...@apache.org> on 2019/02/04 20:07:00 UTC
[jira] [Commented] (MNG-6564) Lack of ability to overwrite
properties of specified dependencies
[ https://issues.apache.org/jira/browse/MNG-6564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16760173#comment-16760173 ]
Karl Heinz Marbaise commented on MNG-6564:
------------------------------------------
If you like to use a more recent version of the dependency than simply write that in your pom file as you already mentioned. This is a clear hint for some later reader that you are confident to use a more recent version than defined by the {{spring-boot-dependencies:bom}}.
If you think about allowing such a thing the following thing could happen:
BOM File 1 defines some properties and a one like this: {{xyz.version}} and BOM File 2 defines also some properties and cause the maintainers don't know each other using the same property {{xyz.version}} and now you define the property in your pom which uses both of the BOM files. So what should be the result? To be honest that would result in a chaos. You can't define properties for all existing dependencies.
> Lack of ability to overwrite properties of specified dependencies
> -----------------------------------------------------------------
>
> Key: MNG-6564
> URL: https://issues.apache.org/jira/browse/MNG-6564
> Project: Maven
> Issue Type: New Feature
> Components: Dependencies
> Affects Versions: 3.3.9
> Reporter: Rik Schaaf
> Priority: Major
>
> For example, if I want to update the flyway version to 4.2.0 in spring boot 1.5 (by default Flyway 3.2.1) I want to do something like this:
> {code:xml}
> <properties>
> <flyway.version>4.2.0</flyway.version>
> <springboot.version>1.5.17.RELEASE</springboot.version>
> </properties>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-dependencies</artifactId>
> <version>${springboot.version}</version>
> <type>pom</type>
> <scope>import</scope>
> </dependency>
> <dependencies>
> </dependencyManagement>
> {code}
> The flyway dependency is already defined in the dependency management of spring-boot-dependencies:
> {code:xml}
> <dependency>
> <groupId>org.flywaydb</groupId>
> <artifactId>flyway-core</artifactId>
> <version>${flyway.version}</version>
> </dependency>
> {code}
> But that same pom also defines flyway.version to be 3.2.1. When I include the flyway dependency in my own dependency management, my application does correctly use Flyway 4.2.0, but if I only provide the property, it incorrectly uses version 3.2.1, meaning that my property was ignored. I have heard from others that you can forcefully override a property by using a commandline parameter or an environment variable, but I would prefer to use a property in my pom file instead.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)