NetBeans Forums

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

Maven project dependency in application?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Filip Van Raemdonck
Posted via mailing list.





PostPosted: Wed Aug 12, 2009 7:54 pm    Post subject: Maven project dependency in application? Reply with quote

Hi all,

I've been looking everywhere I could think of, but haven't found an answer
to the following question:

What's the (best?) way to add a library built from a Maven project into
a Netbeans project, as a dependency?
For that matter, what does "adding a dependency" on a project actually
do? Modify the classpath?

I've found no way to do the first, and no clear answer to the latter.
If I missed something I'd gladly be pointed to the right documentation.


Kind regards,

Filip

--
http://www.sysfs.be/
Back to top
Filip Van Raemdonck
Posted via mailing list.





PostPosted: Wed Aug 12, 2009 8:07 pm    Post subject: Maven project dependency in application? Reply with quote

Hi all,

On Wed, Aug 12, 2009 at 09:54:05PM +0200, Filip Van Raemdonck wrote:
Quote:

I've been looking everywhere I could think of, but haven't found an answer
to the following question:

What's the (best?) way to add a library built from a Maven project into
a Netbeans project, as a dependency?

I realized I forgot some information: the library was provided as a maven
source project, and I built the jar file (through NetBeans IDE) myself.

Quote:
For that matter, what does "adding a dependency" on a project actually
do? Modify the classpath?

I've found no way to do the first, and no clear answer to the latter.
If I missed something I'd gladly be pointed to the right documentation.


Kind regards,

Filip

--
http://www.sysfs.be/
Back to top
Dave Heaton
Posted via mailing list.





PostPosted: Thu Aug 13, 2009 3:49 am    Post subject: Maven project dependency in application? Reply with quote

Hi Filip,

I posted a quick blog that outlines how I've been using Maven
libraries in a NetBeans suite:

http://analogsilence.com/2009/08/12/netbeans-maven-dependency-wrapping/

The process I describe does two things:

* copies Maven dependencies into your cluster's "modules/ext"
directory at build time (see http://wiki.netbeans.org/DevFaqWrapperModules)

* includes Maven dependencies as "class-path-extensions" in your
project.xml file (also see http://wiki.netbeans.org/DevFaqHowPackageLibraries)

It's definitely not an ideal solution, but like you, I couldn't find
anything at the time when I wrote it. It's used in an environment
where we have a large dependency set (over 60 libraries) and manually
managing library wrappers would be a nightmare. I also didn't want to
store libraries in SCM.

Just make sure the Maven library you've built from sources is deployed
to a repository somewhere, or at the very least, installed in your
local repository (via "mvn install").

Hope this helps.

-Dave

On 12-Aug-09, at 4:39 PM, Dave Heaton wrote:

Quote:


Begin forwarded message:

Quote:
From: Filip Van Raemdonck <address-removed>
Date: August 12, 2009 2:07:08 PM GMT-06:00
To: address-removed
Subject: Re: [openide-dev] Maven project dependency in application?
Reply-To: address-removed

Hi all,

On Wed, Aug 12, 2009 at 09:54:05PM +0200, Filip Van Raemdonck wrote:
Quote:

I've been looking everywhere I could think of, but haven't found
an answer
to the following question:

What's the (best?) way to add a library built from a Maven project
into
a Netbeans project, as a dependency?

I realized I forgot some information: the library was provided as a
maven
source project, and I built the jar file (through NetBeans IDE)
myself.

Quote:
For that matter, what does "adding a dependency" on a project
actually
do? Modify the classpath?

I've found no way to do the first, and no clear answer to the
latter.
If I missed something I'd gladly be pointed to the right
documentation.


Kind regards,

Filip

--
http://www.sysfs.be/

Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform 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