system-rules icon indicating copy to clipboard operation
system-rules copied to clipboard

Maven deps picks up junit 4.11-beta-1

Open binkley opened this issue 10 years ago • 9 comments
trafficstars

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

binkley avatar Nov 25 '14 22:11 binkley

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.

stefanbirkner avatar Jan 16 '15 00:01 stefanbirkner

Current is 4.12 - http://search.maven.org/#artifactdetails%7Cjunit%7Cjunit%7C4.12%7Cjar.

binkley avatar Jan 16 '15 00:01 binkley

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.

ShaneSkyWalker avatar Nov 09 '16 03:11 ShaneSkyWalker

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).

sschuberth avatar Feb 13 '18 14:02 sschuberth

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.

matthewmcgarvey avatar Aug 17 '18 12:08 matthewmcgarvey

Did you encounter any problems with JUnit 4.11-beta-1 or is it "only" a "hygiene concern".

stefanbirkner avatar Aug 22 '18 20:08 stefanbirkner

that dependency has a dependency that can resolve to a snapshot

matthewmcgarvey avatar Aug 22 '18 21:08 matthewmcgarvey

I know, but I like to understand your problem. Do you "only" want no snapshot dependencies or do you have a more serious problem?

stefanbirkner avatar Aug 22 '18 23:08 stefanbirkner

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 👍

matthewmcgarvey avatar Aug 23 '18 12:08 matthewmcgarvey