You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by mikeottinger <mi...@hotmail.com> on 2008/04/24 22:05:55 UTC

Adding maven-compiler-plugin to super POM

Hello, I'm trying to come up with a way such that new maven projects I create
are ready to use JDK 1.5 by inheritance from a super POM. I'm having no
luck, hence this post. I'm new to maven (thanks to this forum for telling me
maven defaults to jdk 1.3) so super POMs are a little unfamiliar to me, from
searching this forum I'm told that creating a pom.xml in the parent
directory of my project "somehow" does the trick. I created one, added the
plugin for maven-compiler-plugin, ran mvn install, but I still get jdk
compiling errors. Does anyone have any suggestions in setting a jdk level
globally for my environment? Are super POMs even the way to go? I tend to
create a lot of little projects for prototyping and having to tell Maven I
want jdk 1.5 for each of them is annoying. Thanks in advance!
-- 
View this message in context: http://www.nabble.com/Adding-maven-compiler-plugin-to-super-POM-tp16851994s177p16851994.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Adding maven-compiler-plugin to super POM

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
You need to specify this pom as a <parent> element in your child
pom...simply adding it in the parent directory doesn't magically do it
for you ;-) Also, super-pom is normally reserved to mean the pom
included in the maven core...the true super pom. A more appropriate term
is a corporate pom for a corp wide setup, or just a parent pom.

-----Original Message-----
From: mikeottinger [mailto:mikeottinger@hotmail.com] 
Sent: Thursday, April 24, 2008 4:06 PM
To: users@maven.apache.org
Subject: Adding maven-compiler-plugin to super POM


Hello, I'm trying to come up with a way such that new maven projects I
create
are ready to use JDK 1.5 by inheritance from a super POM. I'm having no
luck, hence this post. I'm new to maven (thanks to this forum for
telling me
maven defaults to jdk 1.3) so super POMs are a little unfamiliar to me,
from
searching this forum I'm told that creating a pom.xml in the parent
directory of my project "somehow" does the trick. I created one, added
the
plugin for maven-compiler-plugin, ran mvn install, but I still get jdk
compiling errors. Does anyone have any suggestions in setting a jdk
level
globally for my environment? Are super POMs even the way to go? I tend
to
create a lot of little projects for prototyping and having to tell Maven
I
want jdk 1.5 for each of them is annoying. Thanks in advance!
-- 
View this message in context:
http://www.nabble.com/Adding-maven-compiler-plugin-to-super-POM-tp168519
94s177p16851994.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Adding maven-compiler-plugin to super POM

Posted by Daniel King <dk...@vurv.com>.
In your pom.xml file add the following:

	<build>
		<plugins>
			<plugin>
	
<groupId>org.apache.maven.plugins</groupId>
	
<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

Thanks,
Daniel King
Vurv

The information contained in this message may be privileged and
confidential and protected from disclosure. If the reader of this
message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you
are hereby notified that any dissemination, distribution or copying of
this communication is strictly prohibited. If you have received this
communication in error, please notify me immediately by replying to the
message and deleting it from your computer. Thank you. 

-----Original Message-----
From: mikeottinger [mailto:mikeottinger@hotmail.com] 
Sent: Thursday, April 24, 2008 4:06 PM
To: users@maven.apache.org
Subject: Adding maven-compiler-plugin to super POM


Hello, I'm trying to come up with a way such that new maven projects I
create
are ready to use JDK 1.5 by inheritance from a super POM. I'm having no
luck, hence this post. I'm new to maven (thanks to this forum for
telling me
maven defaults to jdk 1.3) so super POMs are a little unfamiliar to me,
from
searching this forum I'm told that creating a pom.xml in the parent
directory of my project "somehow" does the trick. I created one, added
the
plugin for maven-compiler-plugin, ran mvn install, but I still get jdk
compiling errors. Does anyone have any suggestions in setting a jdk
level
globally for my environment? Are super POMs even the way to go? I tend
to
create a lot of little projects for prototyping and having to tell Maven
I
want jdk 1.5 for each of them is annoying. Thanks in advance!
-- 
View this message in context:
http://www.nabble.com/Adding-maven-compiler-plugin-to-super-POM-tp168519
94s177p16851994.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Adding maven-compiler-plugin to super POM

Posted by mikeottinger <mi...@hotmail.com>.
Hi guys, thanks for the replies. I read up on parent/child POMs and now
understand what I was doing (or wasn't in this case). So maybe I'll modify
my intitial question, is there anyway to configure my environment (Mac OS X)
to tell Maven I always want JDK 1.5? It'd be nice if it inferred this from
my JAVA_HOME setting. Or is it just an accepted practice that every Maven
project must be explicitly set to JDK 1.5 via the maven-compiler-plugin?
Thanks again.



mikeottinger wrote:
> 
> Hello, I'm trying to come up with a way such that new maven projects I
> create are ready to use JDK 1.5 by inheritance from a super POM. I'm
> having no luck, hence this post. I'm new to maven (thanks to this forum
> for telling me maven defaults to jdk 1.3) so super POMs are a little
> unfamiliar to me, from searching this forum I'm told that creating a
> pom.xml in the parent directory of my project "somehow" does the trick. I
> created one, added the plugin for maven-compiler-plugin, ran mvn install,
> but I still get jdk compiling errors. Does anyone have any suggestions in
> setting a jdk level globally for my environment? Are super POMs even the
> way to go? I tend to create a lot of little projects for prototyping and
> having to tell Maven I want jdk 1.5 for each of them is annoying. Thanks
> in advance!
> 

-- 
View this message in context: http://www.nabble.com/Adding-maven-compiler-plugin-to-super-POM-tp16851994s177p16897186.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org