Hi all,

I have a project that is targetted for a JDK 1.4.2 environment and
implements the DOM Level 2 API that is supplied in the corresponding
rt.jar.  I need to be able to build this project with m2 on a system
that has both JDK 1.5 (the default) and JDK 1.4.2 installed.  The
project cannot be compiled against the 1.5 rt.jar alone since this
contains DOM Level 3 API, which specifies many more methods.

The options seem to be:

1) Fork the compiler and supply an executable config param to point to
the system-dependant JDK 1.4.2 javac, thus using the 1.4.2 rt.jar and
hence DOM Level 2 API.

2) Be able to include the DOM Level 2 API in the bootclasspath, thus
over-riding the DOM Level 3 API in JDK 1.5's rt.jar.

I'm not a big fan of (1) since system-specific information will be
held within the POM.  Even if I use an expression like
"${java.home}/../jdk1.4.2/bin/javac", this still assumes something
about the whereabouts of the JDK.  For these scenarios, do you think
it would make sense to introduce a JDK version compiler config param
which cross-referenced a list of JDK definitions in settings.xml?  The
resolved java.home could then be used in the plexus-compiler-*
projects when deriving the necessary rt.jar path.

I prefer (2), but it appears there's no way of specifying the
bootclasspath in plexus-compiler-api.  Ideally my project would have a
DOM Level 2 API dependency which I could flag as a bootclasspath jar
(yet another scope?) and that would take precendence over whatever JDK
I was using.

I'd be interested in what options I have to achieve just compliation
in this setup using m2 beta1, and also how this problem could be
tackled more elegantly in future.

Cheers,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to