stefanbirkner / system-rules

A collection of JUnit rules for testing code which uses java.lang.System.
http://stefanbirkner.github.io/system-rules
Other
546 stars 71 forks source link

maven pick a snapshot dependency of commons-io #32

Closed laurentleseigneur closed 8 years ago

laurentleseigneur commented 9 years ago

when organization uses system-rules for testing, specific maven settings agains maven repo & mirrors makes it hard to resolve commons-io to 2.5-SNAPSHOT as suggested in 1.12.1 in a smart way, specially on CI build on docker

i suggests to fix version instead of allowing a range.

https://github.com/stefanbirkner/system-rules/pull/30

akhleung commented 9 years ago

Having the same issue, I think -- my builds are failing because there's a dependency on commons-io:jar:2.6-SNAPSHOT.

stefanbirkner commented 9 years ago

I think that version ranges are the best way for defining the versions of a library's dependencies. If you want to have a fixed version of commons-io for your test then you can add

<dependency>
  <groupId>commons-io</groupId>
  <artifactId>commons-io</artifactId>
  <version>[2.4]</version>
  <scope>test</scope>
</dependency>

to your pom.xml.

laurentleseigneur commented 9 years ago

Thanks for your response Stefan.

I already applied this to make version 1.12.1 work as expected, and the initial goal of my PR was to prevent users having the same issue.

If you want to stay with this ranged-version pattern, which i understand, just close my PR, but may be you could add a guidance paragraph in the README.md to avoid this confusing maven dependency resolutions.

stefanbirkner commented 8 years ago

System Rules 1.15.0 does not depend on commons-io anymore.