The purpose of the launcher is to easily start the repository server without the need to add all the required implementation jars to the classpath of your project. When using the launcher, you only need the launcher jar on the classpath, and the launcher will then construct a classloader containing the required dependencies. This also means that you don't need to update classpaths if they change between Daisy versions.
More precisely, the launcher supports launching of 3 different things:
- the Daisy Runtime CLI
- the Daisy Runtime
- the remote repository client
Except for the CLI, you usually start these things with the purpose of being able to talk to them. For this, you still need the required repository APIs in your classloader.
The launcher jar is also executable using java -jar, in which case it will start the Daisy Runtime CLI.
Some pointers to examples:
- The Daisy Runtime CLI launcher is used by the daisy-repository-server script and repository-server service wrapper
- The Daisy Runtime and remote repository client launchers are used by the testcases found in the source tree below repository/test. If you'll look in the Maven pom there, you'll see it only has the various API jars, and the launcher jar, as dependencies. The code using the launcher is in AbstractDaisyTestCase.