NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

How does maven work in 6.7.1?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
kcavanaugh



Joined: 25 Sep 2008
Posts: 4

PostPosted: Fri Nov 27, 2009 9:35 pm    Post subject: How does maven work in 6.7.1? Reply with quote

I'm trying to create a simple library in NB 6.7.1 under maven. Unfortunately
it defaults to source level 1.3
(why do you do that? Most people are using a more recent version of Java
than that).
I tried to fix this in project properties, but setting the source level to
1.6 is ignored.
I tried several times to edit the pom.xml to fix this (including following
the instructions in
http://forums.netbeans.org/ptopic5628.html), but I can't get the pom file to
parse properly or else
find some unknown plugin (this is why I hate maven).

After attempting to follow the directions in the above link, I ended up with
the following pom file:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish</groupId>
<artifactId>pfl</artifactId>
<build>
<plugins>
<plugin>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<packaging>jar</packaging>
<version>1.0</version>
<name>pfl</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

This of course does not work because there is no plugin. Trying to include
source/target outside of
plugin seems to indicate that it needs to be in plugin. So how is this
supposed to work?
And why isn't NB doing it's job and hiding this maven nonsense in the
project better?
--
View this message in context: http://old.nabble.com/How-does-maven-work-in-6.7.1--tp26523276p26523276.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
geoffw



Joined: 17 Nov 2009
Posts: 4

PostPosted: Mon Nov 30, 2009 4:44 am    Post subject: Reply with quote

Hi,

You need to configure the maven-compiler-plugin - the pom.xml you posted doesn't bind your configuration directives to anything.

This is what you need:

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

Cheers
Geoff
Back to top
Melongo Annabel
Posted via mailing list.





PostPosted: Mon Nov 30, 2009 5:49 pm    Post subject: How does maven work in 6.7.1? Reply with quote

Do you have the jdk 1.6 installed in your machine?


From: kencavanaugh <address-removed>
To: address-removed
Sent: Wed, November 25, 2009 7:47:00 PM
Subject: [nbusers] How does maven work in 6.7.1?


I'm trying to create a simple library in NB 6.7.1 under maven. Unfortunately
it defaults to source level 1.3
(why do you do that? Most people are using a more recent version of Java
than that).
I tried to fix this in project properties, but setting the source level to
1.6 is ignored.
I tried several times to edit the pom.xml to fix this (including following
the instructions in
http://forums.netbeans.org/ptopic5628.html), but I can't get the pom file to
parse properly or else
find some unknown plugin (this is why I hate maven).

After attempting to follow the directions in the above link, I ended up with
the following pom file:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.glassfish</groupId>
<artifactId>pfl</artifactId>
<build>
<plugins>
<plugin>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<packaging>jar</packaging>
<version>1.0</version>
<name>pfl</name>
http://maven.apache.org
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

This of course does not work because there is no plugin. Trying to include
source/target outside of
plugin seems to indicate that it needs to be in plugin. So how is this
supposed to work?
And why isn't NB doing it's job and hiding this maven nonsense in the
project better?
--
View this message in context: http://old.nabble.com/How-does-maven-work-in-6.7.1--tp26523276p26523276.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo