Skip to content

Commit 1b82c88

Browse files
marcphilippAndrei94
authored andcommitted
Reintroduce compile dependency on apiguardian-api in Maven POMs
Resolves junit-team#1105.
1 parent eec46af commit 1b82c88

File tree

4 files changed

+41
-19
lines changed

4 files changed

+41
-19
lines changed

build.gradle

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ buildscript {
66
// mavenLocal()
77
maven { url 'https://plugins.gradle.org/m2/' }
88
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
9-
maven { url 'http://repo.spring.io/plugins-release' }
109
}
1110
dependencies {
1211
classpath('com.diffplug.spotless:spotless-plugin-gradle:3.6.0')
1312
classpath('com.github.ben-manes:gradle-versions-plugin:0.17.0')
14-
classpath('io.spring.gradle:propdeps-plugin:0.0.10.RELEASE')
1513
classpath('org.ajoberstar:gradle-git-publish:0.3.2')
1614
classpath('org.ajoberstar:gradle-git:1.7.2')
1715
classpath('org.junit.platform:junit-platform-gradle-plugin:1.0.1')
@@ -117,9 +115,7 @@ allprojects { subproj ->
117115
}
118116

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

125121
tasks.withType(Test) { task ->
@@ -254,10 +250,6 @@ allprojects { subproj ->
254250
subprojects { subproj ->
255251
if (subproj.name in mavenizedProjects) {
256252
apply plugin: 'maven'
257-
apply plugin: 'propdeps'
258-
apply plugin: 'propdeps-maven'
259-
apply plugin: 'propdeps-idea'
260-
apply plugin: 'propdeps-eclipse'
261253
apply plugin: 'signing'
262254

263255
if (subproj.name in platformProjects) {
@@ -269,13 +261,6 @@ subprojects { subproj ->
269261
subproj.version = vintageVersion
270262
}
271263

272-
dependencies {
273-
// The 'optional' configuration is provided by the propdeps-plugin and allows
274-
// us to declare dependencies that get flagged as optional in the generated
275-
// Maven POMs.
276-
optional("org.apiguardian:apiguardian-api:${apiGuardianVersion}")
277-
}
278-
279264
javadoc {
280265
options.memberLevel = JavadocMemberLevel.PROTECTED
281266
options.author = true

documentation/documentation.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ asciidoctor {
9595
'vintage-version': project.property('vintageVersion'),
9696
'junit4-version': project.property('junit4Version'),
9797
'apiguardian-version': project.property('apiGuardianVersion'),
98+
'ota4j-version': project.property('ota4jVersion'),
9899
'release-branch': project.property('releaseBranch'),
99100
'revnumber' : project.version,
100101
'mainDir': project.sourceSets.main.java.srcDirs[0],

documentation/src/docs/asciidoc/release-notes/release-notes-5.1.0-M2.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ For a complete list of all _closed_ issues and pull requests for this release, c
99
link:{junit5-repo}+/milestone/18?closed=1+[5.1 M2] milestone page in the JUnit repository
1010
on GitHub.
1111

12+
[[release-notes-5.1.0-M2-overall-improvements]]
13+
=== Overall Improvements
14+
15+
* In 5.0.1, all artifacts were changed to have an _optional_ instead of a mandatory
16+
dependency on the _@API Guardian_ JAR in their published Maven POMs. However, although
17+
the Java compiler should ignore missing annotation types, a lot of users have reported
18+
that compiling tests without having the _@API Guardian_ JAR on the classpath results in
19+
warnings emitted by `javac` that look like this:
20+
+
21+
----
22+
warning: unknown enum constant Status.STABLE
23+
reason: class file for org.apiguardian.api.API$Status not found
24+
----
25+
+
26+
To avoid confusion, the JUnit team has decided to make the dependency to the
27+
_@API Guardian_ JAR _mandatory_ again.
1228

1329
[[release-notes-5.1.0-M2-junit-platform]]
1430
=== JUnit Platform

documentation/src/docs/asciidoc/user-guide/overview.adoc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,23 @@ Snapshot artifacts are deployed to Sonatype's {snapshot-repo}[snapshots reposito
122122
JUnit Vintage test engine implementation that allows to run vintage JUnit tests, i.e. tests
123123
written in the JUnit 3 or JUnit 4 style, on the new JUnit Platform.
124124

125-
[[dependency-metadata-optional-dependencies]]
126-
==== Optional Dependencies
125+
[[dependency-metadata-dependencies]]
126+
==== Dependencies
127127

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

131131
* *Group ID*: `org.apiguardian`
132132
* *Artifact ID*: `apiguardian-api`
133133
* *Version*: `{apiguardian-version}`
134134

135+
In addition, most of the above artifacts have a direct or transitive dependency to the
136+
following _OpenTest4J_ JAR.
137+
138+
* *Group ID*: `org.opentest4j`
139+
* *Artifact ID*: `opentest4j`
140+
* *Version*: `{ota4j-version}`
141+
135142
[[dependency-diagram]]
136143
=== Dependency Diagram
137144

@@ -168,6 +175,19 @@ package org.opentest4j {
168175
[opentest4j]
169176
}
170177
178+
package org.apiguardian {
179+
[apiguardian-api] as apiguardian
180+
note bottom of apiguardian #white
181+
All artifacts except
182+
opentest4j and junit:junit
183+
have a dependency on this
184+
artifact. The edges have
185+
been omitted from this
186+
diagram for the sake of
187+
readability.
188+
endnote
189+
}
190+
171191
jupiter_api ..> opentest4j
172192
jupiter_api ..> commons
173193

0 commit comments

Comments
 (0)