Bug report. Using the junit-jupiter-api-5.0.0 with java version "9" (build 9+181) in IntelliJ 2017.2.5(if that might matter)
Steps to reproduce:-
junit-jupiter-api-5.0.0.jar]opentest4j-1.0.0.jar along with to the lib/ folder.javac --module-path lib -d "target" $(find src -name "*.java")Results into warnings post the compilation of the classes as -
warning: unknown enum constant Status.STABLE
reason: class file for org.apiguardian.api.API$Status not found
warning: unknown enum constant Status.STABLE
2 warnings
On a side note, it would be good to know what exactly is causing these warnings to occur. Since, if I comment out the code using JUnit and execute the same command, things seems to be working fine.
Include module org.apiguardian.api from https://github.com/apiguardian-team/apiguardian into your lib folder.
See Gradle example here: https://github.com/junit-team/junit5-samples/blob/master/junit5-java9-engine/build.gradle#L9
@sormuras thanks for the prompt reply.
junit-jupiter-api? Shouldn't IJ add that to the classpath as well?See https://youtrack.jetbrains.com/issue/IDEA-178888 for details.
Closing this issue as _invalid_.
I still got this warning. Tried 5.0.2 and 5.1.0-M1. Any ideas?
You got this warning without including apiguardian, right?
It will become a mandatory dependency again starting in 5.1.0-RC1.
Wait what? Why? And Why didn't Gradle/Maven automatically pick it up?
That's a long story. In short, it is declared as an optional dependency in its POM. Thus, Gradle/Maven will not pick it up by default. Since it's confusing and annoying we'll remove the optional tag starting in 5.1.0-RC. Then, Maven/Gradle will pick it up automatically and you won't see these warnings anymore.
Oh, so I won't need to declare the dependency myself? Looking forward to 5.1.0-RC1 then!
Right. It will then be an automatic transitive dependency.
I have compile 'org.apiguardian:apiguardian-api:1.0.0' but still get the warning
NeedMoreInformationToHelpException ;-)
I don't even know (yet) if the problem is due to junit. I stated to get the error after I added exclude group: 'junit', module: 'junit' so IDEA and Gradle would use the correct runner, but that could be a decoy.
I was able to remove the warnings by adding compileOnly 'com.google.code.findbugs:jsr305:3.0.2'. apiguardian had no effet.
Most helpful comment
That's a long story. In short, it is declared as an
optionaldependency in its POM. Thus, Gradle/Maven will not pick it up by default. Since it's confusing and annoying we'll remove theoptionaltag starting in 5.1.0-RC. Then, Maven/Gradle will pick it up automatically and you won't see these warnings anymore.