S Kumar
S Kumar

Reputation: 3

Adding custom jars to camel-k integration

Lets say I have utility jar called validation.jar which can validate some string to be forwarded.

How can I add this validation.jar along with camel-k integration in minkube.

example :

import com.validation.Util;
import org.apache.camel.builder.RouteBuilder;

public class MyRoute extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        //from("timer:tick").log(Util.validate("dummy message - new"));
        from("timer:tick").log("dummy message - new");
    }
}

to get com.validation.Util class we need validation.jar available with camel-k. How to provide that.

Upvotes: 0

Views: 1275

Answers (2)

Nicolas Filotto
Nicolas Filotto

Reputation: 44995

Starting from camel-k 1.9.x, it is possible to provide a dependency located in the local filesystem by using the file:// prefix when specifying the dependency, like the next example:

kamel run -d file://path/to/validation.jar MyRoute.java

Upvotes: 0

Raimondas M
Raimondas M

Reputation: 11

There is just one way of achieving your goal. Store your java classses with pom.xml file for building jar in github repository. After that you can use Jitpack.io. Jitpack will build and store jar file in its registry. Finally, you can use as dependency on kamel run command.

Upvotes: 1

Related Questions