NetBeans Forums

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

misconfigured Maven project

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



Joined: 15 Mar 2011
Posts: 49

PostPosted: Thu Apr 21, 2011 1:24 am    Post subject: misconfigured Maven project Reply with quote

Hi

Netbeans 7.0 complains for the very same maven project that Netbeans 6.9.1 opens without a problem. Has anybody else faced this?

Venkat
Back to top
Alniks



Joined: 25 Apr 2011
Posts: 6

PostPosted: Mon Apr 25, 2011 12:11 pm    Post subject: Reply with quote

I have the same problem and had to switch to 6.9.1 for now
Back to top
vra5107



Joined: 15 Mar 2011
Posts: 49

PostPosted: Mon Apr 25, 2011 6:33 pm    Post subject: Reply with quote

I am using Netbeans 7. I think it's the stupid Windows security that is doing this. Netbeans 7.0 is working fine on my Ubuntu.

I tried installing in C:\ root directory to see if I will find any luck. I tried moving the .netbeans to C:\ root directory to see if that will work. Nothing has worked so far.
Back to top
gros_bidule



Joined: 22 Jun 2010
Posts: 215

PostPosted: Mon Apr 25, 2011 10:54 pm    Post subject: Reply with quote

Hi,
can you show your pom.xml ?
NB6.9 uses (internal) Maven 2 and NB7 Maven3. Did you try to use external Maven binaries ? (Maven2 with NB7)
Back to top
Alniks



Joined: 25 Apr 2011
Posts: 6

PostPosted: Tue Apr 26, 2011 7:03 am    Post subject: Reply with quote

gros_bidule wrote:
Hi,
can you show your pom.xml ?
NB6.9 uses (internal) Maven 2 and NB7 Maven3. Did you try to use external Maven binaries ? (Maven2 with NB7)

I can't show the pom, but I can tell that I used external Maven 2, which successfully build the projects. When I tried to build the projects with internal NB7 maven I got an error. I believe the problem may be connected with projects that contains modules, because some projects open fine. Here is one more post pointing to the problem with maven projects with modules http://forums.netbeans.org/viewtopic.php?t=38465.
Back to top
vra5107



Joined: 15 Mar 2011
Posts: 49

PostPosted: Tue Apr 26, 2011 5:56 pm    Post subject: Reply with quote

Hi

I had external maven configured when I was using 6.9. When I installed 7.0 it imported the configuration from 6.9 which also configured the external maven in 7.0. Essentially I am using external Maven 2.2.1 in Netbeans 7.0.

By the way I think its worth mentioning that I am defending Netbeans against in IDE wars here !!! So please help me stay proud.

Venkat
Back to top
vra5107



Joined: 15 Mar 2011
Posts: 49

PostPosted: Wed Apr 27, 2011 11:08 pm    Post subject: Reply with quote

Aight

First of all, for the impatient the solution is to copy the settings.xml into ${user_home}\.m2 directory. ( Ex: C:\Users\Venkat\.m2 ( On Windows 7 )).

I found the reason why this is happening. There is only one way to specify maven settings.xml in Netbeans. As in it is not possible to specify project specific maven settings. You typically configure it in Tools -> Options -> Maven.

If my understanding is right Netbeans uses this settings.xml that is configured in options only during building. It does not use this for any netbeans related stuff ( like for reading through the project and its modules. ) This is the reason the project was showing this error.

If this is how Netbeans deals with the settings.xml, there is room for improvement.

Venkat
Back to top
Alniks



Joined: 25 Apr 2011
Posts: 6

PostPosted: Fri Apr 29, 2011 1:35 pm    Post subject: Reply with quote

It seams that NB7 do not understand profiles.xml from the projects built with external maven 2. It's a pity, I have to stick to 6.9.1 while working on old projects.
Back to top
ionuion



Joined: 03 Feb 2010
Posts: 190

PostPosted: Fri Apr 29, 2011 3:18 pm    Post subject: Reply with quote

Alniks,
I can confirm what you said regarding profiles.xml, I'll just add more details:

Comparing Netbeans 6.9.1 to 7.0
Both have defined external installation of maven 2.2.1 (tools->options->miscellaneous->maven->maven home field)

Create new Maven project

Netbeans 6.9.1: File, New Project, Categories=Maven, Projects=Maven Project, Next, Maven Archetypes=Maven Quickstart Archetype, project details
Netbeans 7.0: New Project, Categories=Maven, Projects=Java Application, project details

Create profiles.xml
extend the project node, right click on the Project Files node
Netbeans 6.9.1: context menu containing Create profiles.xml is displayed
Netbeans 7.0: not possible to create profiles.xml

Open project with profiles.xml
Netbeans 6.9.1: the profiles.xml file is visible under the Project Files node
Netbeans 7.0: the profiles.xml is not visible in the Projects pane

Having the project opened at previous step, look for the profile definitions
Right click on the project node, Properties, Categories=Configurations.
Netbeans 6.9.1: The profiles defined in profiles.xml are present under Configurations
Netbeans 7.0: The profiles defined in profiles.xml are not present under Configurations

I find the change decision very consistent - not supporting profiles.xml at all. I guess the decisions were made based on the fact that profiles.xml is no longer supported in maven 3.0.
A backwards compatible love would be to check what maven version the user is using and based on that to deploy the old or the profile.xml-less behaviour.

I guess the following holds true:
Using old style? use the old NetBeans 6.9.1.
NetBeans 7 encourage new styles. Want it? migrate your profiles to settings.xml
Back to top
Javier.Ortiz
Posted via mailing list.





PostPosted: Fri Apr 29, 2011 4:10 pm    Post subject: misconfigured Maven project Reply with quote

Netbeans 7.0 comes with Maven 3. You might need to configure it to use Maven 2 for your projects.

Javier A. Ortiz Bultr
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Fri Apr 29, 2011 6:20 pm    Post subject: misconfigured Maven project Reply with quote

profiles.xml files have been removed in maven 3.0.

http://jira.codehaus.org/browse/MNG-4060

Milos

On Fri, Apr 29, 2011 at 3:35 PM, Alniks <address-removed> wrote:
Quote:
It seams that NB7 do not understand profiles.xml from the projects built with external maven 2. It's a pity, I have to stick to 6.9.1 while working on old projects.




Back to top
Alniks



Joined: 25 Apr 2011
Posts: 6

PostPosted: Thu May 05, 2011 6:21 am    Post subject: Re: misconfigured Maven project Reply with quote

Milos Kleint wrote:
profiles.xml files have been removed in maven 3.0.

http://jira.codehaus.org/browse/MNG-4060

Milos

On Fri, Apr 29, 2011 at 3:35 PM, Alniks <address-removed> wrote:
Quote:
It seams that NB7 do not understand profiles.xml from the projects built with external maven 2. It's a pity, I have to stick to 6.9.1 while working on old projects.





Unfortunately, I work with maven 2 project.
Back to top
Alniks



Joined: 25 Apr 2011
Posts: 6

PostPosted: Thu May 05, 2011 6:23 am    Post subject: Re: misconfigured Maven project Reply with quote

Javier.Ortiz wrote:
Netbeans 7.0 comes with Maven 3. You might need to configure it to use Maven 2 for your projects.

Javier A. Ortiz Bultr


How can I do so?
Back to top
emiddio-frontier
Posted via mailing list.





PostPosted: Thu May 05, 2011 9:43 pm    Post subject: [SPAM] Re: misconfigured Maven project Reply with quote

tools/options/maven

gary

----- Original Message -----
From: "Alniks" <address-removed>
To: <address-removed>
Sent: Wednesday, May 04, 2011 11:23 PM
Subject: [nbusers] misconfigured Maven project


Quote:

Javier.Ortiz wrote:
Quote:
Netbeans 7.0 comes with Maven 3. You might need to configure it to use
Maven 2 for your projects.

Javier A. Ortiz Bultr


How can I do so?



Back to top
Alniks



Joined: 25 Apr 2011
Posts: 6

PostPosted: Tue May 10, 2011 6:36 am    Post subject: Re: [SPAM] Re: misconfigured Maven project Reply with quote

emiddio-frontier wrote:
tools/options/maven

gary

----- Original Message -----
From: "Alniks" <address-removed>
To: <address-removed>
Sent: Wednesday, May 04, 2011 11:23 PM
Subject: [nbusers] misconfigured Maven project

Quote:

Javier.Ortiz wrote:
Quote:
Netbeans 7.0 comes with Maven 3. You might need to configure it to use
Maven 2 for your projects.

Javier A. Ortiz Bultr


How can I do so?


Changing maven installation to external maven 2 doesn't help. Though, as I wrote, projects are built fine after change.
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