Skip to content

Commit

Permalink
Reintroduce compile dependency on apiguardian-api in Maven POMs
Browse files Browse the repository at this point in the history
Resolves junit-team#1105.
  • Loading branch information
marcphilipp authored and Andrei94 committed Jun 23, 2018
1 parent eec46af commit 1b82c88
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 19 deletions.
17 changes: 1 addition & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ buildscript {
// mavenLocal()
maven { url 'https://plugins.gradle.org/m2/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath('com.diffplug.spotless:spotless-plugin-gradle:3.6.0')
classpath('com.github.ben-manes:gradle-versions-plugin:0.17.0')
classpath('io.spring.gradle:propdeps-plugin:0.0.10.RELEASE')
classpath('org.ajoberstar:gradle-git-publish:0.3.2')
classpath('org.ajoberstar:gradle-git:1.7.2')
classpath('org.junit.platform:junit-platform-gradle-plugin:1.0.1')
Expand Down Expand Up @@ -117,9 +115,7 @@ allprojects { subproj ->
}

dependencies {
// The following dependency is necessary to avoid compiler warnings about
// not being able to find the @API annotation when compiling test sources.
testCompileOnly("org.apiguardian:apiguardian-api:${apiGuardianVersion}")
api("org.apiguardian:apiguardian-api:${apiGuardianVersion}")
}

tasks.withType(Test) { task ->
Expand Down Expand Up @@ -254,10 +250,6 @@ allprojects { subproj ->
subprojects { subproj ->
if (subproj.name in mavenizedProjects) {
apply plugin: 'maven'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
apply plugin: 'signing'

if (subproj.name in platformProjects) {
Expand All @@ -269,13 +261,6 @@ subprojects { subproj ->
subproj.version = vintageVersion
}

dependencies {
// The 'optional' configuration is provided by the propdeps-plugin and allows
// us to declare dependencies that get flagged as optional in the generated
// Maven POMs.
optional("org.apiguardian:apiguardian-api:${apiGuardianVersion}")
}

javadoc {
options.memberLevel = JavadocMemberLevel.PROTECTED
options.author = true
Expand Down
1 change: 1 addition & 0 deletions documentation/documentation.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ asciidoctor {
'vintage-version': project.property('vintageVersion'),
'junit4-version': project.property('junit4Version'),
'apiguardian-version': project.property('apiGuardianVersion'),
'ota4j-version': project.property('ota4jVersion'),
'release-branch': project.property('releaseBranch'),
'revnumber' : project.version,
'mainDir': project.sourceSets.main.java.srcDirs[0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ For a complete list of all _closed_ issues and pull requests for this release, c
link:{junit5-repo}+/milestone/18?closed=1+[5.1 M2] milestone page in the JUnit repository
on GitHub.

[[release-notes-5.1.0-M2-overall-improvements]]
=== Overall Improvements

* In 5.0.1, all artifacts were changed to have an _optional_ instead of a mandatory
dependency on the _@API Guardian_ JAR in their published Maven POMs. However, although
the Java compiler should ignore missing annotation types, a lot of users have reported
that compiling tests without having the _@API Guardian_ JAR on the classpath results in
warnings emitted by `javac` that look like this:
+
----
warning: unknown enum constant Status.STABLE
reason: class file for org.apiguardian.api.API$Status not found
----
+
To avoid confusion, the JUnit team has decided to make the dependency to the
_@API Guardian_ JAR _mandatory_ again.

[[release-notes-5.1.0-M2-junit-platform]]
=== JUnit Platform
Expand Down
26 changes: 23 additions & 3 deletions documentation/src/docs/asciidoc/user-guide/overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,23 @@ Snapshot artifacts are deployed to Sonatype's {snapshot-repo}[snapshots reposito
JUnit Vintage test engine implementation that allows to run vintage JUnit tests, i.e. tests
written in the JUnit 3 or JUnit 4 style, on the new JUnit Platform.

[[dependency-metadata-optional-dependencies]]
==== Optional Dependencies
[[dependency-metadata-dependencies]]
==== Dependencies

All of the above artifacts have an `optional` dependency in their published Maven POMs on
All of the above artifacts have a dependency in their published Maven POMs on
the following _@API Guardian_ JAR.

* *Group ID*: `org.apiguardian`
* *Artifact ID*: `apiguardian-api`
* *Version*: `{apiguardian-version}`

In addition, most of the above artifacts have a direct or transitive dependency to the
following _OpenTest4J_ JAR.

* *Group ID*: `org.opentest4j`
* *Artifact ID*: `opentest4j`
* *Version*: `{ota4j-version}`

[[dependency-diagram]]
=== Dependency Diagram

Expand Down Expand Up @@ -168,6 +175,19 @@ package org.opentest4j {
[opentest4j]
}
package org.apiguardian {
[apiguardian-api] as apiguardian
note bottom of apiguardian #white
All artifacts except
opentest4j and junit:junit
have a dependency on this
artifact. The edges have
been omitted from this
diagram for the sake of
readability.
endnote
}
jupiter_api ..> opentest4j
jupiter_api ..> commons
Expand Down

0 comments on commit 1b82c88

Please sign in to comment.