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

Path-problem with local dependency (jar) on windows #3257

Closed
casdtodtenhoefer opened this issue May 6, 2022 · 4 comments · Fixed by #3265
Closed

Path-problem with local dependency (jar) on windows #3257

casdtodtenhoefer opened this issue May 6, 2022 · 4 comments · Fixed by #3265
Labels
kind/bug Something isn't working

Comments

@casdtodtenhoefer
Copy link

Hello,

we have problems using a local dependency, running "kamel run" on Windows (Camel K 1,9,0).

Added mvn:de.org.legacy:legacy:jar:1.0.0 to the Integration's dependency list
spectrum - 2022/05/06 09:15:32 Pulling base image  (insecure=true)...
spectrum - 2022/05/06 09:15:32 Composing layers...
spectrum - 2022/05/06 09:15:32 Pushing image localhost:5000/maven_de_org_legacy_legacy_1_0_0_legacy-1_0_0_jar:1.0.0 (insecure=true)...
spectrum - 2022/05/06 09:15:34 existing blob: sha256:b611d19c07e6ee68e2cf32ef13168c78ffabd66b64465cbff8c50cade0ac6aa0
spectrum - 2022/05/06 09:15:34 existing blob: sha256:d2207430ab734fbbdc7a6f7437b98de7b39bf0d491a761b35d8b2634c67a0724
spectrum - 2022/05/06 09:15:34 localhost:5000/maven_de_org_legacy_legacy_1_0_0_legacy-1_0_0_jar:1.0.0: digest: sha256:e4d480c915d9f11e2bfe2b00c41a94729115afa0124006a2552d2fcf559d6367 size: 426
Uploaded: ./src/main/resources/legacy.jar to localhost:5000/maven_de_org_legacy_legacy_1_0_0_legacy-1_0_0_jar:1.0.0
spectrum - 2022/05/06 09:15:34 Pulling base image  (insecure=true)...
spectrum - 2022/05/06 09:15:34 Composing layers...
Error: Error trying to upload file://./src/main/resources/legacy.jar to the Image Registry.: wrong dir format for C:\Users\USER\AppData\Local\Temp\camel-k766362677\maven_legacy.jar_md5:. (expected "local:remote")

As you can see there is a problem with the windows-path. I think that the colon after the drive letter is interpreted as a delimiter.

Best Regards,
Danny

@johnpoth
Copy link
Member

johnpoth commented May 6, 2022

Thank you @casdtodtenhoefer for the detailed report! I created the issue in spectrum which is where I think the issue lies.

As a workaround you can upload the dependencies manually by using spectrum directly:

spectrum build --base scratch --push-insecure -t localhost:5000/maven_de_org_legacy_legacy_1_0_0_legacy-1_0_0_jar:1.0.0 src/main/resources/legacy.jar

Looks like you've already uploaded the JAR so you will have to also upload the sha1 and md5 files as Maven will look for them and fail if it doesn't find them so something like

spectrum build --base scratch --push-insecure -t localhost:5000/maven_de_org_legacy_legacy_1_0_0_legacy-1_0_0_jar_md5:1.0.0 src/main/resources/legacy.jar_md5:.

spectrum build --base scratch --push-insecure -t localhost:5000/maven_de_org_legacy_legacy_1_0_0_legacy-1_0_0_jar_sha1:1.0.0 src/main/resources/legacy.jar_sha1:.

And you should be all set! You can now reference your legacy jar in your integrations if you enable the registry trait:

kamel run integration-legacy.java -d mvn:de.org.legacy:legacy:1.0.0 -t registry.enabled=true (we should probably write a doc about this...)

Thanks !

@squakez squakez added the kind/bug Something isn't working label May 6, 2022
johnpoth added a commit to johnpoth/camel-k that referenced this issue May 12, 2022
johnpoth added a commit to johnpoth/camel-k that referenced this issue May 12, 2022
johnpoth added a commit to johnpoth/camel-k that referenced this issue May 16, 2022
johnpoth added a commit that referenced this issue May 16, 2022
@johnpoth
Copy link
Member

Should be fixed in 1.9.2 (under vote)

@casdtodtenhoefer
Copy link
Author

Hi @johnpoth,

thank you for your effort. Should the problem be fixed in the new 1.9.2 nightly build? In my test the problem still occurred.

Error: Error trying to upload file://../../../../../resources/legacy.jar to the Image Registry.: wrong dir format for C:\Users\Username\AppData\Local\Temp\camel-k892884173\maven_legacy.jar_md5:. (expected "local:remote")

Operator version: 1.9.2-nightly
Kamel CLI version: 1.9.2-nightly

Am I doing anything wrong?

johnpoth added a commit to johnpoth/camel-k that referenced this issue May 18, 2022
@johnpoth
Copy link
Member

Hi @casdtodtenhoefer! Sorry looks like I forgot to handle the checksum files; unfortunately I don't have a windows machine nearby to test this... I've added the fix on my branch

Would you be able to test the fix ? You should just need to clone the repo and build the client make build-kamel. If not it's okay we'll wait for the next release.

Thanks again for the feedback !

johnpoth added a commit to johnpoth/camel-k that referenced this issue Jun 2, 2022
johnpoth added a commit that referenced this issue Jun 3, 2022
squakez pushed a commit to jboss-fuse/camel-k that referenced this issue Jun 6, 2022
…n Windows

(cherry picked from commit 0ec183b)

(cherry picked from commit apache/camel-k@6e946b656)
tadayosi added a commit to tadayosi/camel-k that referenced this issue Sep 29, 2022
…gistry on Windows"

This reverts commit 0ec183b.

Since container-tools/spectrum#8 fix is released this workaround is no
longer needed.
tadayosi added a commit to tadayosi/camel-k that referenced this issue Sep 29, 2022
… extra semicolon"

This reverts commit 89794bf.

Since container-tools/spectrum#8 fix is released this workaround is no
longer needed.
squakez pushed a commit that referenced this issue Sep 30, 2022
… on Windows"

This reverts commit 0ec183b.

Since container-tools/spectrum#8 fix is released this workaround is no
longer needed.
squakez pushed a commit that referenced this issue Sep 30, 2022
… semicolon"

This reverts commit 89794bf.

Since container-tools/spectrum#8 fix is released this workaround is no
longer needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants