I have a Netbeans Java Project under Subversion (svn). This is shared with another guy working on the project.
The project requires an external library that we have as a jar file. Now, when either of us makes a change and commits it, the project’s library dependencies fail as we have different paths for the library ( as we are working on different machines the location of the jar file is different ).
This means that every time I update my repository, I have to resolve library dependencies.
Is there a way I can prevent this?
1st way: You can use NetBeans Library support.
Go to Tools->Libraries, and new Library with your jar. Name it the same way on both machines and include to your NB project as Library rather then direct path to jar.
2nd way: use relative path.
Agree on having jar located at
../lib/foo.jarand use this path in NB project3rd way: use property file.
Add file named, for example,
build.propertiesbut don’t commit it to svn. So both of you will have different local version of that file.Content should be something like next:
In your
build.xmlinclude this file:In your
nbproject/project.propertiesfind a reference to the jar — it will look like:change it to
Also you may want to add
build.propertiesinto ignore list for svn to avoid commiting it.