Hi Roland Asmann, Roland wrote:
[snip] >> > If you use toolchains, it should not matter what JRE you use to run >> Maven, >> > the compiler plugin will use the toolchain you specify. >> > >> > The question you need to ask yourself is which JDK should the >> toolchain be >> > driving, and I cannot answer that... if animal-sniffer says that they >> > are only using the public JRE api then it does not matter which JDK >> > you use. >> >> It does, if the JDK is not compatible. And this is the case for some >> parts of JDBC 3 vs. 4 (included in Java 6). > > Which appears to be the case here. >> >> > And if you have surefire running with both JREs then you should be >> > safe anyway >> >> If your module e.g. implements a JDBC Connector this is simply not >> possible (see commons-dbcp as precedence). > > Any suggestions on how to solve this? The thing is that we really want > to have the same version on both artifacts, since they are (more or > less) the same. We had the same problem for an artifact and took more or less the same solution like dbcp: One project with two "version lines" for the release - 1.x for Java 5/JDBC 3 and 2.x for Java 6/JDBC 4. The code is the same, but compiling with Java 5 activated a profile that did filter the source code of the project before compiling (different source directory configured abviously) and set a different value for the property containing the project's version. The code filter used comments like (IIRC): =========== %< ============= /*JDBC4**/ ... code depending on JDBC 4 //*JDBC4*/ =========== %< ============= and replaced the starting comment with '/*JDBC4' and the ending comment with 'JDBC4*/' when building for Java 5. However, this filter plugin is an internal one processing regular expressions on files, but I am quite sure there are some freely available that can do the same (or use antrunner plugin with an ant task). - Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org