-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Jan,
Jan Nielsen wrote: > I'm a newbie to Maven and Continuum, so aplogies if this is obvious. I'm > not sure if this is a Maven question or Continuum question, or perhaps > both, so I thought I'd try here first. > > When dealing with multiple projects which need different JDK for > compilation, it's possible to use the source and target elements for the > maven-compiler-plugin for each project to define the desired byte-code: > > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <version>2.0</version> > <configuration> > <source>1.5</source> > <target>1.5</target> > </configuration> > </plugin> > > but, to avoid JDK library swapping, I would much rather be able to defined > which one of my multiple JDKs should be used for compilation and test > execution, akin to what is done in Eclipse with configured JDKs. Is this > possible in Maven and/or Continuum. > > Specifically, I have code which must be JDK 1.3 only, I have library code > which needs to be JDK 1.3 compatible but typically runs in a JDK 5 > environment, and I have application code which is JDK 5 only. My > mixed-mode library code has backport of some of the JDK 1.4 and JDK 5 > functionality which if I're running in JDK 5 environment I take advantage > of via reflection; otherwise, these services are implemented with JDK 1.3 > constructs. My test code needs to test both modes of operation, i.e., JDK > 1.3 environments and JDK 5 environments so my unit tests for this library > must be executed twice, once in each environment, and my code must be > compiled in JDK 1.3. Does that make sense? > > Any thoughts? Can't you simply ensure that the desired JDK is the first item of the system path of your invoking shell. Something like export PATH=$MY_JAVA_HOME/bin:$PATH or set PATH=%MY_JAVA_HOME%\bin;%PATH% and then invoke mvn. Run a java -version before to verify your setup. If this works create a *.sh or *.bat file to make your life easier. Be arware that on windows systems the jdk binaries are dumped in system32 what is quite ahead in the path. So it does NOT work to set your users local PATH variable. > > Many thanks, > > -Jan Regards Jörg -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFE5NTPmPuec2Dcv/8RAnWHAJ47rwV3yUE+44DLRSsCYY5L8+LtJgCfWL1Z 4/lrapzh+VfSGUrU3NB3Lq4= =lxOj -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]