On Tue, 16 Aug 2016 09:10:06 +0200, Jörg Schaible wrote:
Hi Gilles,
Gilles wrote:
Hi.
Suppose that
commons-rng-core-1.0.jar
depends on JDK 1.6.
And that we wish to offer utilities (e.g. random strings) and other
syntactic sugar (such as Java 8 streams) in
commons-rng-utils-1.0.jar
that would depend on JDK 1.8.
Is it possible?
Yes. Have a look at XStream
(https://github.com/x-stream/xstream/blob/master/xstream/pom.xml), it
already does this (since
years), currently to support lambda expressions. It declarers simply
a
second compiler execution. Note, there's a bug in Maven that forces
you to
define as many excludes in the second execution as in the first one.
IIUC, it is not exactly what I had in mind, which would amount to
having two separate JARs: "core" and "utils".
"core" is anticipated to be stable (hopefully) while "utils" could
evolve faster and possibly in a non-compatible way.
I.e. we could have
core-1.0
utils-1.0
depends on core-1.0
utils-1.1
depends on core-1.0
utils-2.0
depends on core-1.0
core-1.1 (e.g. after adding a new RNG implementation)
utils-2.1
depends on core-1.1
Regards,
Gilles
There are some minor drawbacks though. Android users fail to use the
jar,
because there's no support for Java 8. App servers running with Java
7 may
fail if they scan the libraries in the classpath for annotations
(e.g.
http://x-stream.github.io/faq.html#Compatibility_webSphere_8).
Cheers,
Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org