Apache Karaf 3.0.2 で厄介な問題が発生しました。フィーチャー リポジトリを追加したい。これは私の非公開の Nexus スナップショット リポジトリにあり、ユーザー名とパスワードで保護されています。すべてが私の中で正しく述べられていますsettings.xml
~/.m2/リポジトリ/settings.xml:
<servers>
<server>
<id>test</id>
<username>karaf</username>
<password>karafpass</password>
</server>
</servers>
org.ops4j.pax.url.mvn.cfg:
org.ops4j.pax.url.mvn.repositories= \
http://repo1.maven.org/maven2@id=central, \
http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release, \
http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, \
http://zodiac.springsource.com/maven/bundles/release@id=gemini, \
http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, \
https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@norelease, \
https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases, \
http://192.168.178.25:8081/nexus/content/repositories/snapshots@id=test@snapshots@noreleases
機能リポジトリを追加するコマンド:
feature:repo-add mvn:com.test/com.test.feature/1.0.0-SNAPSHOT/xml/features
最初の試みで私は得る:
Error executing command: Error resolving artifact com.test:com.test.feature:xml:features:1.0.0-SNAPSHOT:
Could not find artifact com.test:com.test.feature:xml:features:1.0.0-SNAPSHOT in apache (http://repository.apache.org/content/groups/snapshots-group/)
なぜ失敗するのですか?エラー ステートメントは正しいのですが、スナップショット リポジトリでアーティファクトが見つからないのはなぜですか? これが私のNexusで見ることができるものですrequest.log
:
192.168.178.25 - - [25/Dez/2014:15:44:40 +0100] "GET /nexus/content/repositories/snapshots/com/test/com.test.feature/1.0.0-SNAPSHOT/maven-metadata.xml HTTP/1.1" 401 0
192.168.178.25 - - [25/Dez/2014:15:44:43 +0100] "GET /nexus/content/repositories/snapshots/com/test/com.test.feature/1.0.0-SNAPSHOT/com.test.feature-1.0.0-SNAPSHOT-features.xml HTTP/1.1" 401 0
192.168.178.25 - - [25/Dez/2014:15:44:43 +0100] "GET /nexus/content/repositories/snapshots/com/test/com.test.feature/1.0.0-SNAPSHOT/com.test.feature-1.0.0-SNAPSHOT-features.xml HTTP/1.1" 404 1289
問題は、401
karaf がmaven-metadata.xml
後続のコマンドを正しく形成するのを妨げる最初の行にあります。なんで?すべての資格情報は私の M2 の一部ですsettings.xml
。それらを使用してください!
同じコマンドでの次の試行は成功し、次のように表示されrequest.log
ます。
192.168.178.25 - - [25/Dez/2014:15:59:02 +0100] "GET /nexus/content/repositories/snapshots/com/test/com.test.feature/1.0.0-SNAPSHOT/maven-metadata.xml HTTP/1.1" 200 1029
192.168.178.25 - - [25/Dez/2014:15:59:02 +0100] "GET /nexus/content/repositories/snapshots/com/test/com.test.feature/1.0.0-SNAPSHOT/maven-metadata.xml.sha1 HTTP/1.1" 200 40
192.168.178.25 - - [25/Dez/2014:15:59:03 +0100] "GET /nexus/content/repositories/snapshots/com/test/com.test.feature/1.0.0-SNAPSHOT/com.test.feature-1.0.0-20141224.100146-1-features.xml HTTP/1.1" 200 1086
192.168.178.25 - - [25/Dez/2014:15:59:04 +0100] "GET /nexus/content/repositories/snapshots/com/test/com.test.feature/1.0.0-SNAPSHOT/com.test.feature-1.0.0-20141224.100146-1-features.xml.sha1 HTTP/1.1" 200 40
お願いします、あなたの助けが必要ですか?どうすればその問題を取り除くことができますか?