title: Ant build.xml cannot find symbol in included .jar
body: <p>I am migrating multiple projects from a purely desktop Eclipse dev &amp; build to a buildserver (Jenkins-CI) environment.  For this project, I can run the build.xml -> Run As -> Ant build successfully under Eclipse, but it fails when running on the buildserver.  I feel I'm missing something elementary, but I've spent far to many hours looking at this.  Any ideas what is missing?</p>
  
  <p>
      
      
      
      
      
      
      </p>
  
  <pre><code>&lt;path id="lib-classpath"&gt;
      &lt;!-- create a path to the lib files used in the javac compilation --&gt;
      &lt;fileset dir="${lib.dir}"&gt;
          &lt;include name="*.jar"/&gt;
      &lt;/fileset&gt;
  &lt;/path&gt;
  
  &lt;target name="init"&gt;
      &lt;mkdir dir="${bin.dir}"/&gt;
      &lt;mkdir dir="${lib.dir}"/&gt;
  &lt;/target&gt;
  
  &lt;target name="check-DatabaseUtil"&gt;
      &lt;property name="DatabaseUtil.dir" value="../../DatabaseUtil/workspace" /&gt;
      &lt;property name="DatabaseUtil.jar" value="DatabaseUtil.jar" /&gt;
      &lt;echo message="checking for ${DatabaseUtil.dir}/${DatabaseUtil.jar}..."/&gt;
      &lt;available file="${DatabaseUtil.dir}/${DatabaseUtil.jar}" property="DatabaseUtil.present"/&gt;
  &lt;/target&gt;
  
  &lt;target name="do-if-DatabaseUtil" depends="check-DatabaseUtil" if="DatabaseUtil.present"&gt;
      &lt;echo message="copy ${DatabaseUtil.dir}/${DatabaseUtil.jar} into directory ${lib.dir} ..."/&gt;
      &lt;copy file="${DatabaseUtil.dir}/${DatabaseUtil.jar}" todir="${lib.dir}" /&gt;
  &lt;/target&gt;
  
  &lt;target name="compile" depends="init, do-if-DatabaseUtil"&gt;
      &lt;echo message="compile from directory ${source.dir} into directory ${bin.dir} ..." /&gt;
      &lt;javac srcdir="${source.dir}" destdir="${bin.dir}"&gt;
          &lt;classpath refid="lib-classpath"/&gt;
      &lt;/javac&gt;
  &lt;/target&gt;
  
  &lt;target name="jar" depends="compile"&gt;
      &lt;property name="jar.name" value="${ant.project.name}.jar"/&gt;
      &lt;echo message="create file ${jar.name} ..." /&gt;
      &lt;jar basedir="${bin.dir}" jarfile="${jar.name}"&gt;
          &lt;fileset dir="${lib.dir}"&gt;
              &lt;!-- include the library .jars into the file project .jar file --&gt;
              &lt;include name="*.jar"/&gt;
          &lt;/fileset&gt;
      &lt;/jar&gt;
      &lt;echo message="Done" /&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p></p>
  
  <p>when I run the build on the buildserver using Jenkins, it apparently fails to find the DatabaseUtil.jar that is present in the lib dir.  Here's the recorded console output:</p>
  
  <p>Ant compile failure:</p>
  
  <pre><code>Started by user anonymous
  Building in workspace /var/lib/jenkins/workspace/ClassifyProcessor
  Updating svn://10.10.10.194/proficient/ClassifyProcessor/trunk at revision '2014-10-23T11:41:59.153 -0400'
  U         build.xml
  U         .classpath
  At revision 5181
  [ClassifyProcessor] $ ant
  Buildfile: /var/lib/jenkins/workspace/ClassifyProcessor/build.xml
       [echo] Starting project ClassifyProcessor using Java 1.7 and Apache Ant(TM) version 1.8.2 compiled on September 22 2011
  Trying to override old definition of task javac
       [echo] Staring project ClassifyProcessor in /var/lib/jenkins/workspace/ClassifyProcessor ...
  
  init:
  
  check-DatabaseUtil:
       [echo] checking for ../../DatabaseUtil/workspace/DatabaseUtil.jar...
  
  do-if-DatabaseUtil:
  
  compile:
       [echo] compile from directory /var/lib/jenkins/workspace/ClassifyProcessor/src into directory /var/lib/jenkins/workspace/ClassifyProcessor/bin ...
      [javac] Compiling 32 source files to /var/lib/jenkins/workspace/ClassifyProcessor/bin
      [javac] /var/lib/jenkins/workspace/ClassifyProcessor/src/com/hco/processor/Main.java:81: error: cannot find symbol
      [javac]             fmsList = DatabaseService.getFaxMessageStatusRecordsByStatus("Converted", "Inbound", props.getFaxSourceList(), db_connection);
      [javac]                                      ^
      [javac]   symbol:   method getFaxMessageStatusRecordsByStatus(String,String,String[],Connection)
      [javac]   location: class DatabaseService
      [javac] /var/lib/jenkins/workspace/ClassifyProcessor/src/com/hco/processor/Main.java:107: error: cannot find symbol
      [javac]                     FaxMessageStatus fms = DatabaseService.getFaxMessageStatusRecordByIdAndStatus(fmsId, "Converted",  db_connection);
      [javac]                                                           ^
      [javac]   symbol:   method getFaxMessageStatusRecordByIdAndStatus(int,String,Connection)
      [javac]   location: class DatabaseService
      [javac] /var/lib/jenkins/workspace/ClassifyProcessor/src/com/hco/processor/Main.java:346: error: method insertInErrorLog in class DatabaseService cannot be applied to given types;
      [javac]                         DatabaseService.insertInErrorLog(faxMessageStatus.getHost(), "Classify", "Classify", cte.getMessage(), "WARNING", "", faxJobId, fmsId, db_connection);
      [javac]                                        ^
      [javac]   required: String,String,String,String,String,String,Connection
      [javac]   found: String,String,String,String,String,String,int,int,Connection
      [javac]   reason: actual and formal argument lists differ in length
      [javac] /var/lib/jenkins/workspace/ClassifyProcessor/src/com/hco/processor/Main.java:359: error: method insertInErrorLog in class DatabaseService cannot be applied to given types;
      [javac]                         DatabaseService.insertInErrorLog(faxMessageStatus.getHost(), "Classify", "Classify", e.getMessage(), "FATAL", "", faxJobId, fmsId, db_connection);
      [javac]                                        ^
      [javac]   required: String,String,String,String,String,String,Connection
      [javac]   found: String,String,String,String,String,String,int,int,Connection
      [javac]   reason: actual and formal argument lists differ in length
      [javac] 4 errors
  
  BUILD FAILED
  /var/lib/jenkins/workspace/ClassifyProcessor/build.xml:46: Compile failed; see the compiler error output for details.
  
  Total time: 2 seconds
  Build step 'Invoke Ant' marked build as failure
  Sending e-mails to: ktanzer@&lt;mycompany&gt;.com
  Finished: FAILURE
  </code></pre>