I am working on a school project using NetBeans 7, Maven and the NetBeans platform. The project was created using the project template "Maven / POM Project". This is a multi-level "corporate" application that uses several modules (model, integration, business, presentation, the client application itself and several others).
There are dependencies between these modules (but not circular dependencies). The problem is that Maven or NetBeans keep getting confused. There are several types of problems that appear without any triggers. I must continue to recompile the modules, close and reopen NetBeans, clear the NetBeans cache, delete and read dependencies, etc., to temporarily remove the problems. I have all these problems with two different NetBeans installations on Windows XP SP3 and Mac OS X.
Symptoms
1) Sometimes NetBeans decides that none of the classes imported from another module exist (and I get cannot find symbol
errors. This happens repeatedly, sometimes into modules that I successfully compiled a few seconds ago. In most cases, the dependency is not recompiled The necessary dependencies are declared in the POM, jar files exist, and if I deploy them in the project view, I can see the classes in question.
2) Sometimes NetBeans decides that the method of the imported class does not actually throw an exception, which it declares to throw. Since calls to such methods are usually surrounded by try
blocks, NetBeans displays an error with the message a.package.SomeException is never thrown in body of corresponding try statement
. If I do not delete the try block, the module does not compile due to NetBeans. If you delete a block, the module does not compile due to Maven (Maven, for some reason, may see an exception and complains that it is not caught). This also happens repeatedly; I'm not quite sure how to fix this reliably.
At this point, the problems with Maven and NetBeans are so bad that I cannot actually work on the project. If I had not had to use NetBeans and Maven, I would have returned to vim and Makefiles. Does anyone even recognize these problems?
EDIT: I submitted the project, got 30 out of 20 points for it for the extra work that I did on this, and until it leaves the alpha stage, I hope to never have to work with NetBeans again.