system-rules
system-rules copied to clipboard
Maven deps picks up junit 4.11-beta-1
This may not be an issue. Tests work fine that I can tell. More of a "hygiene" concern.
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ system-rules ---
[WARNING] The artifact junit:junit-dep:jar:4.11-beta-1 has been relocated to junit:junit:jar:4.11-beta-1
[INFO] com.github.stefanbirkner:system-rules:jar:1.8.0-SNAPSHOT
[INFO] +- junit:junit:jar:4.11-beta-1:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] \- org.mockito:mockito-core:jar:1.10.8:test
[INFO] \- org.objenesis:objenesis:jar:2.1:test
I think this is because junit:junit-dep 4.11-beta-1 is the first release that relocates to junit:junit. It looks like being a Maven bug. Hopefully I find the bug.
Current is 4.12 - http://search.maven.org/#artifactdetails%7Cjunit%7Cjunit%7C4.12%7Cjar.
I just came across a problem.
When I use "mvn package" to package a project it tells "org.junit.contrib.java.lang.system" not found.
[ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/huangxiangyu/Documents/Coding/JudgeEncode/Huang/src/main/java/soundsystem/CDPlayerTest.java:[8,42] 程序包org.junit.contrib.java.lang.system不存在 [ERROR] /Users/huangxiangyu/Documents/Coding/JudgeEncode/Huang/src/main/java/soundsystem/CDPlayerTest.java:[20,22] 找不到符号 符号: 类 StandardOutputStreamLog 位置: 类 soundsystem.CDPlayerTest [ERROR] /Users/huangxiangyu/Documents/Coding/JudgeEncode/Huang/src/main/java/soundsystem/CDPlayerTest.java:[20,56] 找不到符号 符号: 类 StandardOutputStreamLog 位置: 类 soundsystem.CDPlayerTest [INFO] 3 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.282 s [INFO] Finished at: 2016-11-09T11:16:21+08:00 [INFO] Final Memory: 15M/168M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Huang: Compilation failure: Compilation failure: [ERROR] /Users/huangxiangyu/Documents/Coding/JudgeEncode/Huang/src/main/java/soundsystem/CDPlayerTest.java:[8,42] 程序包org.junit.contrib.java.lang.system不存在 [ERROR] /Users/huangxiangyu/Documents/Coding/JudgeEncode/Huang/src/main/java/soundsystem/CDPlayerTest.java:[20,22] 找不到符号 [ERROR] 符号: 类 StandardOutputStreamLog [ERROR] 位置: 类 soundsystem.CDPlayerTest [ERROR] /Users/huangxiangyu/Documents/Coding/JudgeEncode/Huang/src/main/java/soundsystem/CDPlayerTest.java:[20,56] 找不到符号 [ERROR] 符号: 类 StandardOutputStreamLog [ERROR] 位置: 类 soundsystem.CDPlayerTest [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The Chinese words generally means the package "org.junit.contrib.java.lang.system" not exist.
This is probably solved by https://github.com/stefanbirkner/system-rules/pull/60. The problem is that a few "strange" versions of junit-dep seem to be floating around, which Maven regards as the newest version as more recent JUnit versions were only published under the junit name (not under the junit-dep name).
Can the junit-dep dependency version just be hardcoded 4.11? We just ran into this problem as well. The dependency is 6 years old now, I doubt it will change.
Did you encounter any problems with JUnit 4.11-beta-1 or is it "only" a "hygiene concern".
that dependency has a dependency that can resolve to a snapshot
I know, but I like to understand your problem. Do you "only" want no snapshot dependencies or do you have a more serious problem?
The snapshot dependency has been the only issue. I've read your reasoning elsewhere for why you have it versioned as you do, but hopefully there can be a way to resolve this 👍