I added this to our corporate pom.xml as such:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${source.version}</source>
<target>${target.version}</target>
<executable>${javac.executable}</executable>
<compilerVersion>${source.version}</compilerVersion>
<fork>true</fork>
</configuration>
</plugin>
Then have each project just override the values to suit their needs if these
do not work for them:
<properties>
<!-- source can be overridden in users pom.xml -->
<source.version>1.5</source.version>
<target.version>1.5</target.version>
<javac.executable>${JAVA_HOME}/bin/javac</javac.executable>
---
Thank You…
Mick Knutson, President
BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233
Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Twitter: http://twitter.com/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---
On Mon, Mar 16, 2009 at 3:38 PM, Thor <[email protected]> wrote:
> Last time I checked, the maven compiler plugin uses the 1.4 source level.
> In my case, I use Java 5, so my source level it's 1.5
>
> You tell the plugin to use that source level on it's configuration options:
>
> Here's a pom snippet:
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> </configuration>
> </plugin>
>
> I you wish to guarantee the same exact jdk version for all your developers,
> you should try the enforcer plugin.
>
> On Fri, Mar 13, 2009 at 6:09 AM, tjunak <[email protected]> wrote:
>
> >
> > Hello,
> >
> > I've got some questions about maven-compiler-plugin regarding compiler.
> It
> > seems
> > it is not clarified well on documentation - please help me with those
> > questions as I think
> > they seem important.
> >
> > I would like to be able to know what compiler version is used how to
> > change
> > it in case sources
> > need different version. I know from the (maven-compiler-plugin)
> > documentation that there is some builtin compiler in
> maven-compiler-plugin?
> >
> > What is the version ?
> > Does it change every time new release of JDK ?
> > How to check what is the current default version of the compiler ?
> >
> > There is often a need to compile sources with a specific version of Java
> > compiler then how can I specify a compiler version ?
> >
> > For example in my case is that I need to use: jdk1.6.0 u12
> >
> > How can I do it ?
> > Should I install this JDK on my machine or it exist somwhere packaged as
> an
> > artifact(s) ?
> >
> >
> > This is important as I would like to be sure that all developers will
> > compile sources with correct version
> > of Java compiler and there is always a consistent build.
> >
> >
> >
> > Thank you in advance!
> > Tomasz Junak
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/maven-compiler-plugin---where-does-it-take-compiler-from--tp22495176p22495176.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
> --
> Open Jfree Software in an Open World...
>