views:

13

answers:

0

hi people,

I am getting some very weird behaviour from maven that I have never seen before. Basicaly I refactored some classes, like util.constants (lower c) to util.Constants (capital C), but when I run the maven build to produce a WAR from the command line (mvn clean install), it builds the war project with util.constants (lower c). Upon further investigation, I looked into the target directory. There are a series of directories that get created: classes maven-archiver surefire-reports test-classes war xyz.war

When I look into xyz.war it does not contain Constants.class but it contains constants.class! It seems like somehow there is a refactoring issue or maven is just not reading the source code right? BUT the weird this is within the targer directory, if I just go straight to "classes" (do not go through the compiled war artifact), I see all the correct classes compiled.

So basically, when I run my war file in tomcat, I get a classdefnotfoundError (wrong name)!!! I mean how is util.constants being referenced when it is not even in my source code base!! Is maven caching? I mean how does it know which classes I refactored? This is not allowing me to deploy my web service as I keep getting these errors (others too).

Any idea on how to resolve this issue??? Thank you.