Re: Default java source version
On 7/10/07, Severin Ecker [EMAIL PROTECTED] wrote: i was wondering if i can change de default java source and target version for the compiler plugin to let's say 1.5 oder 1.6 globally in the settings.xml (or somewhere else), and only override it in the pom file if i need an older version. Create a profile in your settings with activeByDefault=true. In that profile, add a section build/plugins/plugin for the maven-compiler-plugin and configure it appropriately. Jochen -- Besides, manipulating elections is under penalty of law, resulting in a preventative effect against manipulating elections. The german government justifying the use of electronic voting machines and obviously believing that we don't need a police, because all illegal actions are forbidden. http://dip.bundestag.de/btd/16/051/1605194.pdf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default java source version
This particular bit of configuration is your friend. Put it in the plugins section of your POM: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin (I forgot to put it in yesterday and kept getting messages that -source 1.3 did not support generics and annotations). Jason -Original Message- From: Severin Ecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 2:12 AM To: Maven Users List Subject: Default java source version Hi, i was wondering if i can change de default java source and target version for the compiler plugin to let's say 1.5 oder 1.6 globally in the settings.xml (or somewhere else), and only override it in the pom file if i need an older version. thanks! cheers, severin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Default java source version
hi jason, yes i know that and i have that section in my POM. what i want is to override the default of java 1.3 so i don't have to do that in all my project POM files which is tedious. that's why i was asking for a way to configure it in the settings.xml. i suppose 1.3 is not hardcoded and can be changed via some property or some other configuration... no? cheers, severin Ferguson, Jason M TSgt 375 CSPTS/SCE wrote: This particular bit of configuration is your friend. Put it in the plugins section of your POM: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin (I forgot to put it in yesterday and kept getting messages that -source 1.3 did not support generics and annotations). Jason -Original Message- From: Severin Ecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 2:12 AM To: Maven Users List Subject: Default java source version Hi, i was wondering if i can change de default java source and target version for the compiler plugin to let's say 1.5 oder 1.6 globally in the settings.xml (or somewhere else), and only override it in the pom file if i need an older version. thanks! cheers, severin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Default java source version
What about creating a global parent pom containing the 1.5 config? On 7/10/07, Severin Ecker [EMAIL PROTECTED] wrote: hi jason, yes i know that and i have that section in my POM. what i want is to override the default of java 1.3 so i don't have to do that in all my project POM files which is tedious. that's why i was asking for a way to configure it in the settings.xml. i suppose 1.3 is not hardcoded and can be changed via some property or some other configuration... no? cheers, severin Ferguson, Jason M TSgt 375 CSPTS/SCE wrote: This particular bit of configuration is your friend. Put it in the plugins section of your POM: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin (I forgot to put it in yesterday and kept getting messages that -source 1.3 did not support generics and annotations). Jason -Original Message- From: Severin Ecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 2:12 AM To: Maven Users List Subject: Default java source version Hi, i was wondering if i can change de default java source and target version for the compiler plugin to let's say 1.5 oder 1.6 globally in the settings.xml (or somewhere else), and only override it in the pom file if i need an older version. thanks! cheers, severin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default java source version
We handled this problem by creating a parent POM that all of our projects inherit from with the following: plugin artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin Then in the individual project you add: parent artifactIdparent-artifact-name/artifactId groupIdcom.my.group/groupId version1.0/version /parent In a couple of projects, we needed to use 1.6 instead of 1.5, so then you have to override the settings in a given child pom: build plugins plugin artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target forktrue/fork executable${JAVA_1_6_HOME}/bin/javac/executable compilerVersion1.6/compilerVersion /configuration /plugin /plugins /build Where JAVA_1_6_HOME is an environment variable that provides the home of a different java version. HTH, Trevor -Original Message- From: Severin Ecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 7:39 AM To: Maven Users List Subject: Re: Default java source version hi jason, yes i know that and i have that section in my POM. what i want is to override the default of java 1.3 so i don't have to do that in all my project POM files which is tedious. that's why i was asking for a way to configure it in the settings.xml. i suppose 1.3 is not hardcoded and can be changed via some property or some other configuration... no? cheers, severin Ferguson, Jason M TSgt 375 CSPTS/SCE wrote: This particular bit of configuration is your friend. Put it in the plugins section of your POM: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin (I forgot to put it in yesterday and kept getting messages that -source 1.3 did not support generics and annotations). Jason -Original Message- From: Severin Ecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 2:12 AM To: Maven Users List Subject: Default java source version Hi, i was wondering if i can change de default java source and target version for the compiler plugin to let's say 1.5 oder 1.6 globally in the settings.xml (or somewhere else), and only override it in the pom file if i need an older version. thanks! cheers, severin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default java source version
Sent to the list... -Original Message- From: Severin Ecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 10:59 AM To: Trevor Spackman Subject: Re: Default java source version yes i could do that. thing is, many of my/our projects are unrelated and shouldn't have a common parent, i only wanted to change the default value of 1.3 to 1.5 or 1.6 but it seems that is is not possible without changing the compiler plugin source... oh well. thanks everyone. cheers, severin Trevor Spackman wrote: We handled this problem by creating a parent POM that all of our projects inherit from with the following: plugin artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin Then in the individual project you add: parent artifactIdparent-artifact-name/artifactId groupIdcom.my.group/groupId version1.0/version /parent In a couple of projects, we needed to use 1.6 instead of 1.5, so then you have to override the settings in a given child pom: build plugins plugin artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target forktrue/fork executable${JAVA_1_6_HOME}/bin/javac/executable compilerVersion1.6/compilerVersion /configuration /plugin /plugins /build Where JAVA_1_6_HOME is an environment variable that provides the home of a different java version. HTH, Trevor -Original Message- From: Severin Ecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 7:39 AM To: Maven Users List Subject: Re: Default java source version hi jason, yes i know that and i have that section in my POM. what i want is to override the default of java 1.3 so i don't have to do that in all my project POM files which is tedious. that's why i was asking for a way to configure it in the settings.xml. i suppose 1.3 is not hardcoded and can be changed via some property or some other configuration... no? cheers, severin Ferguson, Jason M TSgt 375 CSPTS/SCE wrote: This particular bit of configuration is your friend. Put it in the plugins section of your POM: plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.5/source target1.5/target /configuration /plugin (I forgot to put it in yesterday and kept getting messages that -source 1.3 did not support generics and annotations). Jason -Original Message- From: Severin Ecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 10, 2007 2:12 AM To: Maven Users List Subject: Default java source version Hi, i was wondering if i can change de default java source and target version for the compiler plugin to let's say 1.5 oder 1.6 globally in the settings.xml (or somewhere else), and only override it in the pom file if i need an older version. thanks! cheers, severin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Default java source version
hi, sry trevor, i mis-replied there ;) Heinrich Nirschl wrote: Severin, it's generally not a good idea to separate this information from the POM. It would make it harder to reproduce a build. Each member of the development team would get different results if not all have the same settings configuration. - Henry indeed that's probably not a good idea. but then again why is there a default value in the first place, one that's definitely been thought about (otherwise it would be 1.0 or some), and why can't i change that default (well i can it's just not documented anywhere else but the source...) so, if anyone's interested, checking said source i found out that one has to add the following to the profile one's using for a project: profiles profile properties maven.compiler.source1.x/maven.compiler.source maven.compiler.target1.x/maven.compiler.target /properties /profile /profiles cheers, severin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]