Dependency problems with my ANT script

I am having trouble building my project using an Ant script from the command line using Ant. It cannot find a specific import for a specific Java file in my project (which has almost 5000 source files as it is). The import is included in the .jar package, the location of which I set in the Ant file itself. Oddly enough, I can just build the project from the Ant file using an IDE like Eclipse. Any ideas what could be wrong? Thanks!

0


a source to share


3 answers


check the basedir property. If the location of the jar in question is relative, then those based on it will influence behavior in this particular way.

Or it could be that eclipse adds this jar to the classpath when it runs the ant file.

Convert jar location to absolute path

<property name="x" location="${jar.reference}" />

      



and print it

<echo message="${x}" />

      

My ant skills are a bit rusty, so you need to double check the syntax :-).

0


a source


Can you tell us the name of the bank? Whenever I had this problem, it was always related to the versions of the libraries the IDE was using, but not in the ANT_HOME / lib directory, usually for logging or parsing XML.



Which ant command doesn't work? Java / Javac? Have you tried using fork = yes option if it is java?

0


a source


Have you defined your Ant classpath correctly? Eclipse tends to automatically compute the classpath when you run ant ...

0


a source







All Articles