On 28/09/2012 14:42, Ron Wheeler wrote:
On 28/09/2012 3:17 AM, Jesse Long wrote:
Without version ranges, how do I write a library that works with
SLF4J version 1.5.*, but does not work with SLF4J 1.6.*?
Do I depend on, say, version 1.5.11? Then when a user depends on my
library, and on slf4j-api directly, specifying slf4j-api version
1.6.0 in his pom, Maven will link in 1.6.0. So that is pretty useless
to me. If I find a way to enforce version 1.5.11. Then I am loosing
the ability to upgrade to any future version 1.5.*.
I am not sure how version ranges will help you in this case.
Your mythical user is overriding your version 1.5.* with 1.6.* so he
will be in trouble using your library regardless of what you put in
your dependency.
If your library is clearly documented as not being compatible with
versions after 1.5.*, then the user is responsible for making sure
that nothing brings in a later version of slf4j.
You had better write a big note about your restriction since most of
us will just put an exclusion on your transitive dependency for slf4j
and run with the version that we want.
There are not many good libraries that are not upwards compatible and
it is generally safe to run with the latest version of everything.
The good library authors will change the artifact name if the new
version is not capable of supporting code written for the previous
version.
I have yet to see a good case for version ranges and it seems that
they cause these sort of discussions every year or so.
Ron
My library does clearly document the versions of slf4j it depends on -
as a version range in the pom.xml file. How else?
Never mind slf4j for the time being, this affects all libraries.
Please see http://semver.org/
The whole purpose of having a major version number is to clearly
indicate when incompatibility is introduced. It does get introduced, often.
Cheers,
Jesse
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org