ANT & Building an EJB with the JAR task: ClassNotFoundException

Just a quick note. I was trying to build my EJB using ANT and the JAR task and when it ran, I was getting ClassNotFoundExceptions for my utility jars that should have been on the classpath.

<jar jarfile="${ejb-classes.dir}/EJB.jar" 
      basedir="${ejb-classes.dir}"" />

The reason is that the manifest file that existed in the directory was being overwritten by ANT. You need to specify the

manifest

attribute:

<jar jarfile="${ejb-classes.dir}/LoggingEJB.jar" 
      basedir="${ejb-classes.dir}" 
manifest="${ejb-classes.dir}/META-INF/MANIFEST.MF" />

Author: dan

Leave a Reply

Your email address will not be published. Required fields are marked *