This example ports the following examples to Camel K:
Target of this setup was to make the local development experience better, by providing a way to use not only inner classes in route file (OpenApiRoute.java) and avoid using Maven or jitpack, which add major round trips to the development cycle.
You can build the JAR file by mvn install.
Be aware that you have to exclude the route file (OpenApiRoute.java) in the pom.xml as this file will already be provided over the kamel run ... CLI command.
Now that you have the source code packed in the jar file you have to provide this jar file to the Camel K container, where your Camel K route is running.
You can do this by adding the following (modelines)[https://camel.apache.org/camel-k/1.6.x/cli/modeline.html]
to your route file (OpenApiRoute.java).
// camel-k: resource=file:../../../../../target/pojo-jar-1.0.0.jar // camel-k: trait=jvm.classpath=/etc/camel/resources/pojo-jar-1.0.0.jar
It's important to add the JAR file as resource to be compressed.
To run this integration use the following command:
kamel run ./src/main/java/org/apache/camel/OpenApiRoute.java