Can classes in a Spring Boot jar be referenced in the classpath from an ANT task?

Viewed 50

I have a project that has been migrated to Spring Boot 2.4.1 and the self-deployable jar that has been generated places the classes in the BOOT-INF/classes folder. Unfortunately, the classes from this project are being referenced for the compilation (and execution) of other projects as well. The build process uses an ANT task which references this self-deployable JAR in the classpath:

<path id="compile.classpath">
  <pathelement location="${spring.boot.jar}"/>
</path>

<target name="compile">
  <javac ...>
    <classpath refid="compile.classpath"/>
  </javac>
</target>

However, upon migration, since the classes are not in the root of the JAR archive anymore, they aren't visible to the ANT task anymore.

Is there any way of achieving this functionality, without exploding the JAR file prior to executing the ANT task?

  1. Using Maven is not an option, at this point, as it would involve too much work.
  2. Adding the classes to the root of the JAR archive is also not an option.
0 Answers
Related