dsl/camel-jbang/camel-launcher/README.md
This module provides a self-contained executable JAR that includes all dependencies required to run Camel JBang without the need for the JBang two-step process.
The launcher uses Spring Boot's loader tools to create a self-executing JAR with a nested structure, similar to Spring Boot's executable JARs. This provides better performance and avoids classpath conflicts compared to traditional fat JARs.
To build the fat-jar launcher:
mvn clean package
This will create:
camel-launcher-<version>.jar) in the target directory using Spring Boot's nested JAR structurecamel-launcher-<version>-bin.zip and camel-launcher-<version>-bin.tar.gz) in the target directoryjava -jar camel-launcher-<version>.jar [command] [options]
For example:
java -jar camel-launcher-<version>.jar version
java -jar camel-launcher-<version>.jar run hello.java
Extract the distribution archive:
unzip camel-launcher-<version>-bin.zip
# or
tar -xzf camel-launcher-<version>-bin.tar.gz
Use the provided scripts:
# On Unix/Linux
./bin/camel.sh [command] [options]
# On Windows
bin\camel.bat [command] [options]
The launcher uses Spring Boot's nested JAR structure:
camel-launcher-<version>.jar
|
+-META-INF
| +-MANIFEST.MF (Main-Class: org.springframework.boot.loader.launch.JarLauncher)
+-org
| +-springframework
| +-boot
| +-loader
| +-<spring boot loader classes>
+-BOOT-INF
+-classes
| +-org/apache/camel/dsl/jbang/launcher/CamelLauncher.class
| +-<other application classes>
+-lib
+-camel-jbang-core-<version>.jar
+-camel-main-<version>.jar
+-<other dependency JARs>
This structure provides better performance and reliability compared to traditional fat JARs where all classes are merged together.