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

Support additonal Maven repositories for kamel local build #2175

Closed
apupier opened this issue Mar 25, 2021 · 8 comments
Closed

Support additonal Maven repositories for kamel local build #2175

apupier opened this issue Mar 25, 2021 · 8 comments

Comments

@apupier
Copy link
Contributor

apupier commented Mar 25, 2021

it seems that kamel local build is not supporting additional Maven repositories.
I tried:

  • modifying local .m2/settings.xml
  • modifying camel-k-maven-settings config map
  • providing --maven.repository parameter on command-line

see https://camel.zulipchat.com/#narrow/stream/257299-camel-k/topic/Additional.20Maven.20repositories.20with.20kamel.20local.20build

it is preventing from using snapshot versions of Camel K.

@astefanutti
Copy link
Member

I've been able to run kamel local build with the Apache snapshots repository using the --maven-repository option, e.g.:

$ kamel local build --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots --integration-directory=test examples/rest/routes-rest.js

Mind that it's --maven-repository, not --maven.repository, and that the repository must be declared with @snapshots, as documented in https://camel.apache.org/camel-k/latest/configuration/maven.html#_maven_settings.

@apupier
Copy link
Contributor Author

apupier commented Apr 12, 2021

still not working for me:

(base) [apupier@linux camel-k]$ ./kamel local build --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots --integration-directory "/home/apupier/.config/Code/User/globalStorage/redhat.vscode-camelk/java-dependencies-3.7.0" "/home/apupier/ws/camelk-test/Routing.java"
Modeline options have been loaded from source files
Full command: kamel local build --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots --integration-directory /home/apupier/.config/Code/User/globalStorage/redhat.vscode-camelk/java-dependencies-3.7.0 /home/apupier/ws/camelk-test/Routing.java --dependency=mvn:com.github.camel-tooling/camel-lsp-server 
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for org.apache.camel.k:camel-k-loader-java:jar is missing. @ line 36, column 17
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.apache.camel.k.integration:camel-k-integration:1.4.0-SNAPSHOT (/tmp/maven-751781982/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for org.apache.camel.k:camel-k-loader-java:jar is missing. @ line 36, column 17
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
failure while building project: exit status 1

@apupier
Copy link
Contributor Author

apupier commented Apr 12, 2021

but we can notice that there are two fewer dependencies which are not found

Could not find artifact org.apache.camel.k:camel-k-runtime-bom:pom:1.7.0-SNAPSHOT @ line 22, column 19
'dependencies.dependency.version' for org.apache.camel.k:camel-k-runtime:jar is missing. @ line 44, column 17

compared to what i reported initially

@apupier
Copy link
Contributor Author

apupier commented Apr 12, 2021

no failure when using a js file

EDIT: I have same failure after cleaning my local .m2

@apupier
Copy link
Contributor Author

apupier commented Apr 12, 2021

another try and it worked...

(base) [apupier@linux camel-k]$ ./kamel local build --maven-repository=https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots --integration-directory "/home/apupier/.config/Code/User/globalStorage/redhat.vscode-camelk/java-dependencies-3.7.0" "/home/apupier/ws/camelk-test/Routing.java"

@astefanutti
Copy link
Member

astefanutti commented Apr 12, 2021

I think the initial error is solved with using the --maven-repository option, and for some reasons, your local Maven repository was not having the latest versions, and I was about to suggest to clean it.

@astefanutti
Copy link
Member

@apupier Did you get any other issues, or is it ok to close this?

@apupier
Copy link
Contributor Author

apupier commented Apr 13, 2021

still in progress (issue on VS Code side currently) but the specific issue that I reported is solved so I'm closing it. Thanks for the help!

@apupier apupier closed this as completed Apr 13, 2021
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