Skip to content

Commit

Permalink
Clean up JUnit dependency management (#159)
Browse files Browse the repository at this point in the history
* Add junit-bom to dependencyManagement section
* Remove explicit version from junit-xxx dependencies since they now
  are defined by the junit-bom
* Add junit-platform-commons and junit-platform-launcher which are
  direct dependencies of junit-pioneer
* Remove exclusions from junit-pioneer; they are no longer necessary
  because of the junit-bom

Closes #158
  • Loading branch information
sleberknight authored Aug 2, 2022
1 parent e362a69 commit cb38ca4
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<dependencyManagement>

<dependencies>

<!-- ensure all JUnit dependencies have correct version from the JUnit BOM -->
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

</dependencies>

</dependencyManagement>

<dependencies>

<!-- required dependencies -->
Expand Down Expand Up @@ -152,21 +169,30 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<scope>test</scope>
</dependency>

Expand All @@ -175,28 +201,6 @@
<artifactId>junit-pioneer</artifactId>
<version>${junit-pioneer.version}</version>
<scope>test</scope>
<!-- Pioneer has typically been behind Jupiter's current version but still works.
Keeping these exclusions in here until and unless they cause problems, and
let Pioneer use whatever version of JUnit we are using.
-->
<exclusions>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down

0 comments on commit cb38ca4

Please sign in to comment.