Skip to content

Commit

Permalink
Document use of transitive dependencies (#637 / #646)
Browse files Browse the repository at this point in the history
This PR documents the use of transitive dependencies
Pioneer related on.

related: #637
PR: #646
  • Loading branch information
Nicolai Parlog committed Jun 5, 2022
1 parent ef7ff7c commit a752660
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -470,6 +470,26 @@ JUnit Pioneer has an uncharacteristically strong relationship to the JUnit 5 pro
It not only depends on it, it also uses its internal APIs, copies source code that is not released in any artifact, mimics code style, unit testing, build and CI setup, and more.
As such it will frequently have to adapt to upstream changes, so it makes sense to provision for that in the development strategy.

#### Declaring Dependencies

JUnit Jupiter has few external dependencies, but occasionally uses them in its own API and thus has the `requires transitive` directive in [its module declaration](https://github.com/junit-team/junit5/blob/main/junit-jupiter-api/src/module/org.junit.jupiter.api/module-info.java) (for example, `requires transitive org.opentest4j_`).
That means, while JUnit Pioneer _could_ list these dependencies in its build configuration and require these modules in its module declaration, it doesn't _have to_.

It is generally recommended not to rely on transitive dependencies when they're used directly and instead manage them yourself, but this does not apply very well to Pioneer and Jupiter:

* If Jupiter stops using one of these dependencies, there is no point for us to keep using it as we only need them to integrate with Jupiter.
* If Jupiter refactors these module relationships (e.g. by removing the OpenTest4J module from its dependencies and pulling its code into a Jupiter module), we might not be compatible with that new version (e.g. because we still require the removed module, which now results in a split package)
* We can't choose a different dependency version than Jupiter

We hence only depend on "core Jupiter" explicitly.
That is:

* core API: _org.junit.jupiter.api_
* additional APIs as needed, e.g. _org.junit.jupiter.params_
* additional functionality as needed, e.g. _org.junit.platform.launcher_

#### Updating JUnit 5

As [documented](README.md#dependencies) Pioneer aims to use the lowest JUnit 5 version that supports Pioneer's feature set.
At the same time, there is no general reason to hesitate with updating the dependency if a new feature requires a newer version or the old version has a severe bug.
Follow these steps when updating JUnit 5:
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Expand Up @@ -60,7 +60,6 @@ dependencies {

implementation(group = "org.junit.jupiter", name = "junit-jupiter-api")
implementation(group = "org.junit.jupiter", name = "junit-jupiter-params")
implementation(group = "org.junit.platform", name = "junit-platform-commons")
implementation(group = "org.junit.platform", name = "junit-platform-launcher")
"jacksonImplementation"(group = "com.fasterxml.jackson.core", name = "jackson-databind", version = jacksonVersion)

Expand Down
1 change: 0 additions & 1 deletion src/main/module/module-info.java
Expand Up @@ -13,7 +13,6 @@
// see Javadoc for why these aren't transitive
requires org.junit.jupiter.api;
requires org.junit.jupiter.params;
requires org.junit.platform.commons;
requires org.junit.platform.launcher;

requires static com.fasterxml.jackson.core;
Expand Down

0 comments on commit a752660

Please sign in to comment.