Is there a way to add a secured Nexus repository as feature repository to Apache Karaf?
I tried to run the command:
karaf@root()> feature:repo-add http://<user>:<password>@<my-repository>
But I get the following error:
Adding feature url http://<user>:<password>@<my-repository> Error executing command: Server returned HTTP response code: 401 for URL: http://<user>:<password>@<my-repository>
I'm using Apache Karaf 3.0.0.
Thanks, Mickael
The solution is simple.
Install Maven on the server on which Karaf is running and configure it. Generally, you will configure it through the file settings.xml
present in ~/.m2
. The credentials for accessing the Nexus repository are indicated in the file.
Finally, instead of using an HTTP URL for referencing your feature, use a Maven URL of the form:
mvn:<groupId>/<artifactId>/<version>/xml/features
The feature will be resolved through Maven.
您可以将自己的 Maven 存储库添加到org.ops4j.pax.url.mvn.repositories 。
config:edit org.ops4j.pax.url.mvn
config:property-set org.ops4j.pax.url.mvn.repositories http://your.nexus.repo/here
config:update
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.