views:

54

answers:

3

Hi,

We are using an ant script in order to build our application. I recently made a change in one jar required by our app. However, when running the ant script, the compilation fails and the error message shown let me think that the compiler is using a previous version of the jar.

Also, compilation throug my IDE works fine. Manual compilation with the javac command and specifying my new jar works as well.

When looking at the classpath used by ant to build, I can see that the jar seems to be the correct one. So I am a bit lost actually, don't know where to look at ... Any ideas ?

I also wanted to know if this is possible to get the path of the jar javac is really using when compiling a particular class ..

Thanks and regards

+2  A: 

You could try using the verbose switch "-v" when you run ant.

ferrari fan
+1  A: 

Most likely, your ivy.xml is wrong somehow.

CPerkins
A: 

Finally, we managed to find what was wrong.

The ivy.xml was referencing another jar under another name, but had the same classes inside. Ant was using those class instead of my new jar when compiling. The IDE didn't complain because I had a module dependency of the jar I was creating. Removing this dependency lead me to this old jar.

Hard to spot ...

Thanks

Farid