0

I have a number of projects linked with my main project as libraries in NetBeans 7.1. For e.g. Main Project1 DepProject1.lib DepProject2.lib DepProject3.lib

When i made some changes in my Dependent projects(e.g DepProject1) i have to clean build the dependent project and paste in the libraray folder of my main project and then clean build my main project also. Is there any way if i build the main project the dependent projects build automatically and the library of main project updated automatically.

Kai
  • 38,985
  • 14
  • 88
  • 103
  • You may also want to take a look at [Maven](http://maven.apache.org) which handles project and library dependencies (it is one of its objective but not the only one). – Guillaume Polet Apr 25 '13 at 11:40
  • @GuillaumePolet can you give me any example for Maven. – Syed Muhammad Mubashir Apr 26 '13 at 08:44
  • Simply go through the Maven web site. For example, check out the POM in the [5 minutes tutorial](http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html). Each project should contain a pom.xml file that identifies the project with a groupdID-artifactID combination. It also includes version, dependencies, build lifecycle and many other information. If you want to switch to Maven, it is not an automatic-5 minutes process. But in the long run, it is usually an overall improvement on many aspects. – Guillaume Polet Apr 26 '13 at 10:45

1 Answers1

1

Instead of adding the library JAR directly to your project, as shown here, add a library containing your other projects, as shown here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • See the help topic *Creating Dependencies Between Projects* for version-specific details. – trashgod Apr 25 '13 at 11:37
  • By creating libraries for my project it copies the jar from the dist folder of the Dependent project to main project, instead of linking the jar form dependent to parent project which i required. – Syed Muhammad Mubashir Apr 26 '13 at 10:50
  • Check your version's help; mine says, "Whenever you clean and build a project, the IDE also cleans and builds its required projects." – trashgod Apr 26 '13 at 10:53