On 29/03/2008, Richard Chamberlain <[EMAIL PROTECTED]> wrote:
>
> If you using java 5 as your JAVA_HOME I would also recommend setting the
> executable compiler to use.
>
>         <executable>path.to.jdk\1.4.2\bin\javac.exe</executable>
>
> Whilst <source> and <target> go some way to making sure the language is
> correct, they won't pick up the fact that java 1.4 doesn't have a
> certain version of a runtime library.
>
> For example you could have happily used <source> and <target> to compile
> an class that does some XML parsing using java 5 libraries. However when
> you run the code in a 1.4 environment it'll blow up.


you could always set the compiler bootclasspath, as mentioned here:

   http://docs.codehaus.org/x/9fE

so no matter what JDK you use, it will compile against the right classlib:

  <configuration>
    <source>1.3</source>
    <target>1.3</target>
    <compilerArguments>
      <bootclasspath>${some.property}/path/to/some/rt.jar</bootclasspath>
    </compilerArguments>
  </configuration>

then it's just a matter of getting the relevant rt.jar and either putting it
in
a repository, or providing it as part of your project / developer setup.

HTH

Regards,
>
> Rich
>
>
>
> -----Original Message-----
> From: Graham Leggett [mailto:[EMAIL PROTECTED]
> Sent: 28 March 2008 19:29
> To: Maven Users List
> Subject: Re: Best practices for java version?
>
> david delbecq wrote:
>
> > What are the best practice when deploying artifact about java version
> > used for compiling? I read somewhere that the purpose of maven release
>
> > process is to make the build "reproductible", but if that build does
> not
> > include aimed compiler, we can't assure a "rebuild" will be fully
> > compatible with previous build, if the java version changed...
>
> Configure the maven-compiler-plugin to specify the specific java version
>
> you need for that particular build. This will ensure your future rebuild
>
> is repeatable, even with a newer JDK version.
>
> Regards,
> Graham
> --
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Cheers, Stuart

Reply via email to