NetBeans Forums

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

Still having problems with Maven integration

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



Joined: 15 Aug 2008
Posts: 536
Location: Bavaria

PostPosted: Thu Jul 29, 2010 7:55 am    Post subject: Still having problems with Maven integration Reply with quote

Hi,

we have a large Maven based project that I want to open in NetBeans. As I'm the only one using NetBeans, there is not much I can do about the Maven structure.

The Project consists of a total of 14 modules. I can build the complete project (parent pom) and each module from the commandline without problems.

I can build the project from within NetBeans without problems, but the editor complains about errors in the several source files when I open them. Inside the projects tab, a large number of files and packages have the red exclamation mark badge that marks them with an error.

How can it be that NetBeans can build the project (and generate all necessary jar and war files) but still fails to correctly display the source code in the edior?

I have gotten used to do a manual "mvn install" for our Maven projects before opening NetBeans and that usually fixed the problems NetBeans (and only NetBeans!) has with Maven, but this is getting somewhat frustrating...

Any ideas what could be wrong? I know the information is not very complete, but I cannot post all (14) poms here.
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Thu Jul 29, 2010 8:21 am    Post subject: Still having problems with Maven integration Reply with quote

make sure all generated java files are generated into target/generated-sources/FOO where FOO is a subdirectory. That's the most common source of compilation errors in the editor.



On Thu, Jul 29, 2010 at 9:56 AM, tkellerer <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi,

we have a large Maven based project that I want to open in NetBeans. As I'm the only one using NetBeans, there is not much I can do about the Maven structure.

The Project consists of a total of 7 modules. I can build the complete project (parent pom) and each module from the commandline without problems.

I can build the project from within NetBeans without problems, but the editor complains about errors in the several source files when I open them. Inside the projects tab, a large number of files and packages have the red exclamation mark badge that marks them with an error.

How can it be that NetBeans can build the project (and generate all necessary jar and war files) but still fails to correctly display the source code in the edior?


Well, the building is done by maven, not netbeans.
 
Quote:

I have gotten used to do a manual "mvn install" for our Maven projects before opening NetBeans and that usually fixed the problems NetBeans (and only NetBeans!) has with Maven, but this is getting somewhat frustrating...


smells like generated sources. netbeans makes no attempts at building your projects when opening them with the assumption that most of the time your project is uptodate and built. That saves *a lot* of time when loading projects.
 


Milos


Quote:

Any ideas what could be wrong? I know the information is not very complete, but I cannot post all (14) poms here.




Back to top
tkellerer



Joined: 15 Aug 2008
Posts: 536
Location: Bavaria

PostPosted: Thu Jul 29, 2010 11:20 am    Post subject: Re: Still having problems with Maven integration Reply with quote

Milos Kleint wrote:
make sure all generated java files are generated into target/generated-sources/FOO where FOO is a subdirectory. That's the most common source of compilation errors in the editor.
Thanks for the answer.

No, none of the projects is using generated sources.
Sometimes a "mvn install" fixes some of the problems, but in order for NetBeans to recognize that I need to first close NB, run "mvn install" then restart NB
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Thu Jul 29, 2010 11:38 am    Post subject: Still having problems with Maven integration Reply with quote

i suppose your projects do some other non standard magic with sources or binaries..

Milos

On Thu, Jul 29, 2010 at 1:20 PM, tkellerer <address-removed ([email]address-removed[/email])> wrote:
Quote:

Milos Kleint wrote:
Quote:
make sure all generated java files are generated into target/generated-sources/FOO where FOO is a subdirectory. That's the most common source of compilation errors in the editor.


Thanks for the answer.

No, none of the projects is using generated sources.
Sometimes a "mvn install" fixes some of the problems, but in order for NetBeans to recognize that I need to first close NB, run "mvn install" then restart NB




Back to top
gros_bidule



Joined: 22 Jun 2010
Posts: 215

PostPosted: Thu Jul 29, 2010 11:43 am    Post subject: Reply with quote

Have you-tried to clear the NetBeans cache ? (<user-dir>/.netbeans/<nb-version>/var/cache/)
Back to top
tkellerer



Joined: 15 Aug 2008
Posts: 536
Location: Bavaria

PostPosted: Thu Jul 29, 2010 12:50 pm    Post subject: Re: Still having problems with Maven integration Reply with quote

Milos Kleint wrote:
i suppose your projects do some other non standard magic with sources or binaries..
No magic, everything is standard Maven build cycle
Eclipse and InteliJ do not have any issues with those poms.

gros_bidule wrote:
Have you-tried to clear the NetBeans cache ? (<user-dir>/.netbeans/<nb-version>/var/cache/)
Yes.
Thats usually the first thing I do when NetBeans starts behaving strangely.
Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Fri Jul 30, 2010 8:10 am    Post subject: Still having problems with Maven integration Reply with quote

only thing that I can recommend is to file  a bug report with a sample project demonstating the problem.


milos

On Thu, Jul 29, 2010 at 2:50 PM, tkellerer <address-removed ([email]address-removed[/email])> wrote:
Quote:

Milos Kleint wrote:
Quote:
i suppose your projects do some other non standard magic with sources or binaries..

No magic, everything is standard Maven build cycle
Eclipse and InteliJ do not have any issues with those poms.


gros_bidule wrote:
Quote:
Have you-tried to clear the NetBeans cache ? (<user-dir>/.netbeans/<nb-version>/var/cache/)

Yes.
Thats usually the first thing I do when NetBeans starts behaving strangely.




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 cannot 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