views:

50

answers:

2

Hello,

I created a web application and it used several libraries once upon a time. So i added them but later on i found alternative and actually better ways to do the same things. So i removed references from my project for those jars and libraries. Everything works fine but when i move the same project to my friend's laptop Netbeans 6.8 simply doesn't let me deploy the project and gives the whole bundle of errors of libraries that i used previously but i don't now.

I removed all references from build.impl file and then when i deploy it, it works fine. But when i do a clean and build and try to deploy it, build.impl automatically again adds those lines of xml which contain references to libraries an again gives me a whole long list of errors. How do i get rid of this? I am really tired of these silly errors.

Thanks in advance :)

A: 

Hello,

What I would do, is to remove all netbeans specific files and re-create a project from scratch using existing sources on your friends' laptop.

JTS
+1  A: 

You might think about switching to a build system which does dependency management. Maven is natively supported by Netbeans and solves these problems effectively (you get some new problems in place but thatis another story).

There are others, Ivy, Gradle, ... but are not as integrated in Netbeans.

In the pom.xml you have a listing of dependencies which have their dependencies. Maven will walk the dependency tree and get the jar's from a public repository and stores them in your local repository. 3rd party jars which are not publically available can be stored there too, but your friend will have to add them to his repo too. A little script in the root project folder can do wonders here (or your own shared repo, but that is more heavyweight)

Almost all libs can be removed from the lib folder which reduces the size under version control, speeding it up.

Netbeans, Idea, Eclipse+m2eclipse the synch their files on the POM.

Now maven does have its warts, when you try to do things with it slightly left of what it thinks you should do.

Peter Tillemans