BAEL-3347: example of version collision in Maven (#9644)
* BAEL-3347: example of version collision in Maven * BAEL-3347: created multi-module example of version collision in Maven * BAEL-3347: fixed placement of the dependencyManagement section, added maven-enforcer-plugin
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
<module>maven-war-plugin</module>
|
||||
<module>maven-profiles</module>
|
||||
<module>versions-maven-plugin</module>
|
||||
<module>version-collision</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
||||
21
maven-modules/version-collision/child-module/pom.xml
Normal file
21
maven-modules/version-collision/child-module/pom.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>version-collision</artifactId>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>child-module</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>3.3.9</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
44
maven-modules/version-collision/pom.xml
Normal file
44
maven-modules/version-collision/pom.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>maven-all</artifactId>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>version-collision</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>child-module</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-configuration2</artifactId>
|
||||
<version>2.7</version>
|
||||
<!--uncomment section below to exclude commons-lang3 artifact to prevent version collision-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.apache.commons</groupId>-->
|
||||
<!-- <artifactId>commons-lang3</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<!--uncomment section below to use dependencyManagement to prevent version collision-->
|
||||
<!-- <dependencyManagement>-->
|
||||
<!-- <dependencies>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.commons</groupId>-->
|
||||
<!-- <artifactId>commons-lang3</artifactId>-->
|
||||
<!-- <version>3.4</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- </dependencies>-->
|
||||
<!-- </dependencyManagement>-->
|
||||
</project>
|
||||
Reference in New Issue
Block a user