NetBeans Forums

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

Maven Multiproject Classpath uses installed jar when running

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



Joined: 29 Oct 2009
Posts: 3

PostPosted: Thu Oct 29, 2009 1:36 pm    Post subject: Maven Multiproject Classpath uses installed jar when running Reply with quote

I have recently swapped to Netbeans from Eclipse due to the fact that Eclipse is so slow on OS X. The thing I liked about Eclipse was the Maven plugin, when I ran the project Eclipse automatically added the dependencies that were open as projects to the classpath, I then didn't have to do a Maven install on the dependencies. Netbeans is aware that the dependencies are open whilst coding and uses the target/classes folder instead of the installed jar. However, when it comes to running the project the repository jar is used instead on the target/classes folder.

This is annoying as my Maven repo is at a remote location and every time I have to run I have to build the dependencies, this takes quite a while. If the target/classes folder was on the classpath this would take away the need for this as it is set to compile on save.

Is there anyway to get Netbeans to just run the project using the IDE classpath instead of using maven exec plugin?

Alternatively is there a way to add the dependency target/classes folder to the classpath instead of the dependency jar file.

Thanks
Back to top
mkleint
Posted via mailing list.





PostPosted: Thu Oct 29, 2009 4:56 pm    Post subject: Maven Multiproject Classpath uses installed jar when running Reply with quote

duttley wrote:
Quote:
I have recently swapped to Netbeans from Eclipse due to the fact that Eclipse is so slow on OS X. The thing I liked about Eclipse was the Maven plugin, when I ran the project Eclipse automatically added the dependencies that were open as projects to the classpath, I then didn't have to do a Maven install on the dependencies. Netbeans is aware that the dependencies are open whilst coding and uses the target/classes folder instead of the installed jar. However, when it comes to running the project the repository jar is used instead on the target/classes folder.



This is annoying as my Maven repo is at a remote location and every time I have to run I have to build the dependencies, this takes quite a while. If the target/classes folder was on the classpath this would take away the need for this as it is set to compile on save.



Is there anyway to get Netbeans to just run the project using the IDE classpath instead of using maven exec plugin?

it will do so when you change the Compile on Save combo box in project
properties dialog to show "applicatio+test" instead of the "test only"
please note that the exec plugin could still be used on some occations,
like when no binaries were built, or when you modified the filtered
resources. But it should be able to a. compile changes as they happen,
b. redirect the execution from repository jars to output directories..

Milos

Quote:


Alternatively is there a way to add the dependency target/classes folder to the classpath instead of the dependency jar file.



Thanks




Back to top
duttley



Joined: 29 Oct 2009
Posts: 3

PostPosted: Thu Oct 29, 2009 5:23 pm    Post subject: Reply with quote

I have the build/compile/compile on save set to For both Application and Test execution for both projects. It doesn't seem to pick up the changes.I have noticed that it seems to use the maven exec plugin every time though. I tried version 6.8 and that did seem to flip between the two although when using just the IDE compiler it lost my working directory settings.
Back to top
duttley



Joined: 29 Oct 2009
Posts: 3

PostPosted: Thu Oct 29, 2009 6:04 pm    Post subject: Reply with quote

I have worked out why the Maven exec plugin is being called every time, my pom has filtering enabled. Therefore, every time build gets called a new version file is output. When I disable filtering I get a java.lang.UnsatisfiedLinkError for my Sqlite jni library which leads me to think that the IDE is ignoring my working directory.

Looking at the debug from the maven output I am definitely getting a jar file instead of my classes directory.

Any ideas.

Thanks
Back to top
mkleint
Posted via mailing list.





PostPosted: Fri Oct 30, 2009 6:15 am    Post subject: Maven Multiproject Classpath uses installed jar when running Reply with quote

duttley wrote:
Quote:
I have worked out why the Maven exec plugin is being called every time, my pom has filtering enabled. Therefore, every time build gets called a new version file is output. When I disable filtering I get a java.lang.UnsatisfiedLinkError for my Sqlite jni library which leads me to think that the IDE is ignoring my working directory.



Looking at the debug from the maven output I am definitely getting a jar file instead of my classes directory.



Any ideas.



Thanks





file a bug report with sample project to reproduce..

Milos
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