The compiler plugin configuration is in my corporate POM.
Projects only have to define the compiler properties to set the target runtime. You can also set the as -D command line arguments or in settings.xml as <properties> section. Nico. 2007/1/25, Roald Bankras <[EMAIL PROTECTED]>:
Interesting approach. Do you know of some way to generify the maven.compile.runtime property? I think I can put it in settings for example. I'll definatly give this a try. Roald Bankras -----Original Message----- From: nicolas de loof [mailto:[EMAIL PROTECTED] Sent: Thursday, January 25, 2007 8:46 AM To: Maven Users List Subject: Re: configuring JDK I use an alternative solution to setup the compiler for a particular JRE : I use the javac bootclasspath to make javac point to the target runtime rt.jar: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${maven.compile.source}</source> <target>${maven.compile.target}</target> <compilerArguments> <bootclasspath> ${ settings.localRepository}/com/sun/rt/${maven.compile.runtime}/rt-${ maven.compile.runtime}.jar </bootclasspath> </compilerArguments> </configuration> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>rt</artifactId> <version>${maven.compile.runtime}</version> </dependency> </dependencies> <inherited>true</inherited> </plugin> <properties> <maven.compile.source>1.4</maven.compile.source> <maven.compile.runtime>1.4.2_06</maven.compile.runtime> <maven.compile.target>1.4</maven.compile.target> </properties> 2007/1/25, Roald Bankras <[EMAIL PROTECTED]>: > > Hi > > Yes. I've read this. But how do you point to the correct javac. It has > to be done through an environment variable like ${JDK6_HOME}. > Which you could define as a profile property in your settings.xml. > However, how to trigger the correct 'jdk' profile. Using the jdk > activation results in activating the same jdk as maven is using. > > Any other ideas? Prefrebly I don't trigger the profile manually. > > regards > > Roald Bankras > > -----Original Message----- > From: Massimiliano Amato [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 24, 2007 8:34 PM > To: Maven Users List > Subject: Re: configuring JDK > > you could think about using this > > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > <verbose>true</verbose> > <fork>true</fork> > <executable><!-- path-to-javac --></executable> > <compilerVersion>1.3</compilerVersion> > </configuration> > </plugin> > > > Hope this helps > Max > > On 1/23/07, Roald Bankras <[EMAIL PROTECTED]> wrote: > > > > Hi > > > > On the 'introduction-to-profiles' page it is stated that ' one of > > the goals in maven 2 is to consolidate all the information needed to > > run a build into a single file, or file hierarchy which is the POM". > > To my surprise however, it is rather difficult to configure a > > specific JDK ( > i.e. > > JAVA_HOME) for a project. > > > > My situation is as follows. I have multiple projects using version > > 1.4, > > 1.5 and 1.6 JDKs. I've already configured the compiler plugin to use > > the right source and target options. However, what I would like to > > do is to point the compiler to a specific JAVA_HOME environment from > > the settings.xml. > > I suppose this should be possible by using profiles, however > > activating the correct profile is a problem for me. > > > > My final option is to force every developer to first set the correct > > JAVA_HOME as a system environment. Which I would have to configure > > on the buildserver as well (somehow). This however is error prone. > > Therefore, I hope that some of you have a much more flexible sollution. > > > > thx. Regards > > > > > > Roald Bankras > > > > > > > > -- > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.5.432 / Virus Database: 268.17.6/646 - Release Date: > > 1/23/2007 > > 3:36 AM > > > > > > > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.432 / Virus Database: 268.17.8/649 - Release Date: > 1/23/2007 8:40 PM > > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.432 / Virus Database: 268.17.8/649 - Release Date: > 1/23/2007 8:40 PM > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.17.8/649 - Release Date: 1/23/2007 8:40 PM -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.17.10/651 - Release Date: 1/24/2007 6:48 PM --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]