Wayne Fay wrote:
This has been discussed several times on this list.
Sorry, I haven't found these discussions, neihter by searching for
"compiler defaults" nor by searching for "byte code [version]"
IMO, the default compilation target being 1.1 (or another hard-defined
version) meets the rule of least surprise. You can argue that you
don't like 1.1 and you'd prefer 1.3 or even 1.5 but that is another
discussion.
In contrast, the rule of most surprise would be "my build changes when
I change my JDK" or "my build changes when I build things on different
machines". This is the absolute worst thing you can run into when
trying to standardize and control your build process.
I disagree on that. For me it is not surprising at all that my build
changes when I use a different compiler. At the contrary, under certain
cirumstances I'd expect this and would be surprised if the build (or the
result) would not change.
When the build produces the same results in different environments, this
can lead to hard-to-find problems later on. I still think it would be
better if the Maven compiler would produce byte code matching the
version of the JDK Maven is running with. That's what I expect when I do
a javac call and I don't see why Maven should silently change this
behaviour.
While this is not such a big issue (any JVM equal to or greater than 1.1
can indeed exectute JVM 1.1 byte code and the cases where real problems
occur might be rare) the source=1.3 default really surprises the user.
When I create a new project and build it on Maven with a 1.5 JDK
expecting Java 5 features to work, I get error messages like "generics
are not supported in -source 1.3" and do not know where that comes from.
At least that is not very user friendly and I suppose Maven wants to be
user friendly and easy to use.
If you want to target a specific JDK, then simply add the compiler
configuration in your poms. If you feel this has not been documented
sufficiently,
I did not say that *this* is not documented sufficiently, I did say that
the defaults aren't documented at all.
then post a RFE in Jira and someone will add some text
to the proper page(s) on the site.
Done. http://jira.codehaus.org/browse/MCOMPILER-57
--
Gisbert Amm
Softwareentwickler Infrastruktur
WEB.DE GmbH
Brauerstraße 48 · D-76135 Karlsruhe
Tel. +49-721-91374-4224 · Fax +49-721-91374-2740
[EMAIL PROTECTED] · http://www.web.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]