This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 124842 - inheriting project library dependencies
Summary: inheriting project library dependencies
Status: RESOLVED DUPLICATE of bug 47507
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Milos Kleint
URL: http://www.nabble.com/inheriting-proj...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-07 21:33 UTC by fommil
Modified: 2008-01-09 22:15 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fommil 2008-01-07 21:33:54 UTC
Given 2 projects A and B and a 3rd party X.jar

  A depends on X.jar 
  B depends on A (and wants by inheritance X.jar at runtime)

NetBeans currently does not add A's dependencies to the runtime classpath and therefore it is not possible to run any test cases or main methods in B without 
explicitly adding X.jar.

I request that an option be enabled to inherit runtime dependencies from dependent projects (and that changes in A's classpath are propagated). I would prefer if 
this were the default behaviour (i.e. like Eclipse and IDEA).

The current workaround (adding X.jar to B's runtime classpath) is not a satisfactory solution as it is too easy for a development team to neglect to add a runtime 
library to all the effected projects. It also takes a lot of effort to add all the libraries manually and keep it up to date!
Comment 1 Milos Kleint 2008-01-09 10:09:36 UTC
It could be non-trivial to do in ant. The UI/IDE part should be easier, but still a non trivial addition. Not for 6.1. 

On a general level dependency transitivity has both pros and cons. Apache Maven has transitive dependencies and users
get a different set of problems.
1. how to exclude a certain dependency from transitivity?
2. how to synchronize the dependency tree if a single dependency comes from 2 sources but with different versions?
etc.

BTW why do you need it on runtime classpath only? what if the project A exposes some classes from X.jar?
Comment 2 fommil 2008-01-09 11:26:52 UTC
> BTW why do you need it on runtime classpath only? what if the project A exposes some classes from X.jar?

If A exposes classes from X.jar and B makes use of those classes, then X.jar should be on the compile-time dependency list. In Eclipse there is the possibility 
to "export" dependencies which means to make them compile-time dependencies to anything higher in the chain. I would welcome such a feature in 
NetBeans! (Although, getting basic inheritance working is the priority for me).
Comment 3 Jesse Glick 2008-01-09 22:15:12 UTC

*** This issue has been marked as a duplicate of 47507 ***