[
https://issues.apache.org/jira/browse/MNG-8602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Guillaume Nodet closed MNG-8602.
--------------------------------
Resolution: Fixed
> Maven 4 BOM applies main version to all dependencies
> ----------------------------------------------------
>
> Key: MNG-8602
> URL: https://issues.apache.org/jira/browse/MNG-8602
> Project: Maven
> Issue Type: Bug
> Affects Versions: 4.0.0-rc-2
> Reporter: Alexis Tual
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.0.0-rc-3
>
>
> I've tried the simple example from
> [here|https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html]
> for producing a simple BOM with Maven 4, except I've put specific versions:
> {code:xml}
> <project xmlns="http://maven.apache.org/POM/4.1.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.1.0
> https://maven.apache.org/xsd/maven-4.1.0.xsd">
> <groupId>com.test</groupId>
> <artifactId>bom</artifactId>
> <version>1.0.0</version>
> <packaging>bom</packaging>
> <properties>
> <project1Version>5.12.0</project1Version>
> <project2Version>5.11.0</project2Version>
> </properties>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>com.test</groupId>
> <artifactId>project1</artifactId>
> <version>${project1Version}</version>
> </dependency>
> <dependency>
> <groupId>com.test</groupId>
> <artifactId>project2</artifactId>
> <version>${project2Version}</version>
> </dependency>
> </dependencies>
> </dependencyManagement>
> </project>
> {code}
> After installing it, I get the following:
> {code:java}
> ➜ maven4-bom cat ${HOME}/.m2/repository/com/test/bom/1.0.0/bom-1.0.0.pom
> <?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>
> <groupId>com.test</groupId>
> <artifactId>bom</artifactId>
> <version>1.0.0</version>
> <packaging>pom</packaging>
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>com.test</groupId>
> <artifactId>project1</artifactId>
> <version>1.0.0</version>
> </dependency>
> <dependency>
> <groupId>com.test</groupId>
> <artifactId>project2</artifactId>
> <version>1.0.0</version>
> </dependency>
> </dependencies>
> </dependencyManagement>
> </project>
> {code}
> I expect to have the 5.12.0 and 5.11.0 versions for project1 and project2
> defined there, not 1.0.0, while still being able to consume the BOM with the
> 1.0.0 version:
> {code:xml}
> <dependencyManagement>
> <dependencies>
> <dependency>
> <groupId>com.test</groupId>
> <artifactId>bom</artifactId>
> <version>1.0.0</version>
> <type>pom</type>
> <scope>import</scope>
> </dependency>
> </dependencies>
> </dependencyManagement>
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)