Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding dependencies on external packages #1546

Closed
doru1004 opened this issue Jun 18, 2020 · 10 comments
Closed

Adding dependencies on external packages #1546

doru1004 opened this issue Jun 18, 2020 · 10 comments

Comments

@doru1004
Copy link
Contributor

doru1004 commented Jun 18, 2020

Let's say I have a GitHub repo with the third party Java code and I want to add is a dependency since kamel run is complaining that it can't find the package.

Without kamel, what I do is clone the repo then call mvn install and then add the dependency in the pom.xml in the usual way. How would I proceed in the kamel run case?

@lburgazzoli
Copy link
Contributor

you can use a special syntax that allow to leverage jitpack:

kamel run -d github:$user/$repo

@doru1004
Copy link
Contributor Author

I see that this works only with version 1.0.0 and I'm using RC2. I have another issue opened of what happens when I use version 1.0.0: #1542

@lburgazzoli
Copy link
Contributor

you can do the same without the special syntax, you should follow the instructions on the jitpack site so:

  • add a maven repo
  • use the jitpack syntax

@doru1004
Copy link
Contributor Author

As an example, let's assume that the repo I want to install is this one:

https://github.com/apache/camel

What would be the command you have in mind? I'm not sure I understand the steps you suggested.

@doru1004
Copy link
Contributor Author

Looks like I have managed to get the latest version of Kamel to work (build from source with latest master). I might be able to actually use your initial suggestion:

kamel run -d github:$user/$repo

The project Github repo path is similar to this: https://github.com/apache/camel

What is the precise -d parameter I need to construct for that? Is it this:

kamel run -d github:apache/camel <path to my java file>

?

@lburgazzoli
Copy link
Contributor

kamel run -d github:apache/camel

yes

@doru1004
Copy link
Contributor Author

I tried this:

kamel run -d github:$user/$repo path/to/KafkaProducer.java

And the builder errored:

camel-k-kit-brlt2h4evfv6ukf4201g-builder   0/1     Init:Error   0          9s
> kubectl logs camel-k-kit-brlt2h4evfv6ukf4201g-builder
Error from server (BadRequest): container "buildah" in pod "camel-k-kit-brlt2h4evfv6ukf4201g-builder" is waiting to start: PodInitializing

Is there a way to get more information about the failure?

@doru1004
Copy link
Contributor Author

Any way to get more feedback as to what goes on during the building process?

@doru1004
Copy link
Contributor Author

Can you give me an example of a GitHub dependency that you have personally tried and it worked for you? I'm trying to pass dependencies via -d that are unrelated to my example and all I am getting is the error above in the builder.

@doru1004
Copy link
Contributor Author

I have managed to get my example to work so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants