I am trying to use the default-template in my Java project to generate the launch script, based on the ivy dependencies specified in my project. The issue I am facing is that the ivy dependencies are getting picked up and put in the classpath but the main project jar is not getting included in the classpath.(Which gives a class not found exception while trying to run the script) On further investigation and comparison with other scripts I found that there is a line as.
export RUNTIME_CLASSPATH=""
in my generated script. This should have the path to my projects jar but is not getting populated (ex: export RUNTIME_CLASSPATH="$(dirname $0)/../lib/myproject.jar:")
Where exactly do we specify the project referring itself(calling project) in the script??
I have looked into all other files including the build properties, ivy, ivy settings to no avail.
It would be great If someone could help me find what I am missing.
ANT doesn’t have any standard functionality for generating OS specific launch scripts. What you can do is generate an executable jar which can be launched by running java as follows:
The key feature of an executable jar is it’s manifest that specifies both the main class and classpath:
The following ANT project demonstrates how ivy can assist in the creation of executable jars
Example
Run the build
Execute the program
jar is packaged to use dependencies located in a relative “lib” subdirectory
ivy.xml
build.xml