On Mon, 2005-06-13 at 13:12 +0100, Stephen Colebourne wrote:
> --- Simon Kitching <[EMAIL PROTECTED]> wrote:
> > An option is to put something like this in the
> > project.properties:
> > 
> > maven.junit.fork=true
> > maven.junit.jvm=/path/to/jvm12/bin/java
> > 
> > The code then gets compiled with the very best javac
> > implementation
> > available (eg 1.5), but unit-tested using the lowest
> > JVM supported. As
> > long as the unit tests have good coverage this
> > should detect any
> > problems with code calling methods not available on
> > the target JVM.
> 
> This works if maven runs its tests using the jar.
> Often, the tests are run from a directory of class
> files just compiled for the test.

Sorry, I didn't follow that. Why does it matter whether the test classes
are in a jar or not?

> 
> Of course, I should point out that this doesn't really
> gain you anything. Since you must have the lower JDK
> on your box to run the tests, why not compile using
> the lower JDK too. That way, you get the correct
> manifest in the jar - something that I often look at.

What it means is that the actual released code is compiled using the
best java compiler available. Javac should improve with each release.

The manifest will indeed show the java version used to compile the code,
rather than the minimum java version supported by the product. I've been
meaning to request that maven2 include a dependency tag in the pom to
specify supported java version; that could also be used to insert that
info into the manifest.

Note that I'm not disagreeing with Stephen's recommendation of compiling
with the oldest jvm supported; I'm just suggesting another option.

Regards,

Simon


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

Reply via email to