Re: NB and multiple projects

Chuck Williams <[email protected]> Wed, 31 Mar 2010 23:59:44 -1000
Newsgroups gmane.comp.java.netbeans.general
Organization Manawiz
Message-ID <[email protected]>
In general, no-body answers questions on this list other than about the
web site or other general information. Questions like this shoud go to
nbusers.

That said, I recall once seeing a long discussion about why Netbeans
does not package the transitive closure of dependent jars, but it's a
been a while and don't recall the details. I think the essence is that
each project will in general want complete control over the jars it
distributes. Just because one of your dependent jars has a dependency
doesn't mean your project necessarily wants that dependency. E.g., it
may implement a feature you don't need or use, and you may not want to
distribute it.

You can add the subdependencies you do want as direct dependencies.
You can also add your own <copy> task(s) to build.xml to add
anything else you like, and you customize the jar manifest. E.g.,
check out references to manifest and to jar.classpath in build-impl.xml.

Chuck

[email protected] wrote on 03/31/2010 11:19 PM:

Hi all,
I need some help to solve a blocking problem I have. :_(
I've made some NB projects (Java SE) that almost have the same structure:

project_dir
|
+- src
|
+- lib

and few more. Inside "lib" there are 4-5 jars needed for each project, added
as "jar/folder" in the project libraries (either compile or run).

Then I have some dependencies relationships between those projects, currently
managed with "add project" in NB, in the project libraries. Something like A->B-

C<-B<-D with no circular dependencies.

Usually NB builds, for each project, a dist directory with the project jar
file and inside the dist a lib directory with the libraries/jars of that
project. The jar of the project has a manifest correctly pointing to the lib/*.
jar files. So, double-clicking on this jar project (yes, I'm on windows...),
everything works.

But, when I build a project that depend on another project it also creates the
dist and dist/lib dirs with the main project in the dist and inside dist/lib
the jar of the base project on which the main depend. But there are no the jars
of the "inner" project!

Is there a way to solve these dependencies issues, jars, manifest and so on
with NB?
Unfortunately I cannot use maven or introduce maven at this point of the
project.

Help,

Marco