You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Simon Kitching <sk...@apache.org> on 2005/06/14 01:23:51 UTC

maven2: feature request: jvm version info

Hi,

There is currently no way, as far as I know, for a project.xml/pom.xml
to express which minimum version of java the project requires in order
to run.

This is extremely useful information to document.

It could also be used to automatically set the maven.compile.target
value.

This info could be inserted into the generated MANIFEST.MF so users can
see what JVM is supported.

And it could be used to issue an error or warning when the java version
used to compile the code is different from the supported version. As
Stephen Colebourne pointed out on the commons-dev list recently,
releases really need to be compiled with the minimum java version (*not*
just compiled with maven.compile.target set appropriately) in order to
avoid having the compiler resolve method calls to methods that don't
exist in the older java's rt.jar. The problem is not only methods that
simply don't exist in the older system, but also overloading:
  StringBuffer.append(Object);
  StringBuffer.append(StringBuffer); // since 1.4 only

Note that the code
  buf1.append(buf2); 
will compile in both 1.3 and 1.5, but this code compiled in 1.5 will not
run in 1.3 no matter what maven.compile.target is set to.

Compiling with the latest jdk then running the unit tests with the
oldest supported jvm is an option, but potentially easy to stuff up. And
as Stephen also pointed out, that results in misleading java version
info in the MANIFEST.MF; the compiler version is listed not the minimum
supported jvm.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org