File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
src/test/java/com/baeldung/dependency/ordering Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+ <artifactId >dependency-ordering</artifactId >
5
+
6
+ <parent >
7
+ <artifactId >maven-modules</artifactId >
8
+ <groupId >com.baeldung</groupId >
9
+ <version >0.0.1-SNAPSHOT</version >
10
+ </parent >
11
+
12
+ <dependencies >
13
+ <dependency >
14
+ <groupId >org.apache.poi</groupId >
15
+ <artifactId >poi</artifactId >
16
+ <version >5.3.0</version >
17
+ </dependency >
18
+ <!-- Change the order of dependencies to simulate the dependency ordering issue -->
19
+ <dependency >
20
+ <groupId >com.opencsv</groupId >
21
+ <artifactId >opencsv</artifactId >
22
+ <version >4.2</version >
23
+ </dependency >
24
+ </dependencies >
25
+
26
+ </project >
Original file line number Diff line number Diff line change
1
+ package com .baeldung .dependency .ordering ;
2
+
3
+ import org .apache .commons .collections4 .MapUtils ;
4
+ import org .junit .jupiter .api .Test ;
5
+
6
+ import java .util .HashMap ;
7
+
8
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
9
+
10
+ class DependencyOrderingUnitTest {
11
+
12
+ @ Test
13
+ void whenCorrectDependencyVersionIsUsed_thenShouldCompile () {
14
+ assertEquals (0 , MapUtils .size (new HashMap <>()));
15
+ }
16
+ }
Original file line number Diff line number Diff line change 17
17
<modules >
18
18
<module >animal-sniffer-mvn-plugin</module >
19
19
<module >compiler-plugin-java-9</module >
20
+ <module >dependency-ordering</module >
20
21
<module >dependency-exclusion</module >
21
22
<module >host-maven-repo-example</module >
22
23
<module >jacoco-coverage-aggregation</module >
You can’t perform that action at this time.
0 commit comments