![](/img/trans.png)
[英]Pax Exam: Resolve Karaf feature repository (XML file) from non-standard Maven repository
[英]Karaf omits local maven repository on feature:repo-add
我正在嘗試在Karaf 3.0.1上部署一個應用程序。
在啟動bin/karaf clean
腳本並嘗試添加駐留在本地 maven 存儲庫中的所需功能時~/.m2/repository
(我已手動檢查存儲庫以確保它們存在)。
我運行的命令:
karaf@root()> 功能:repo-add mvn:com.mycompany.myproject.common/common-karaf-features/1.1.0/xml/features
我收到以下錯誤:
添加功能網址 mvn:com.mycompany.myproject.common/common-karaf-features/1.1.0/xml/features
執行命令時出錯:解析工件 com.mycompany.myproject.common:common-karaf-features:xml:features:1.1.0 時出錯:無法傳輸工件 com.mycompany.myproject.common:common-karaf-features:xml:features :1.1.0 從/到中央 ( http://repo1.maven.org/maven2/ ):
傳輸文件時出錯:連接被拒絕
我已經嘗試在etc/org.ops4j.pax.url.mvn.cfg
手動設置 maven 存儲庫
有沒有人至少知道這種行為的可能原因? 為什么 karaf 不查看本地倉庫?
你快到了,你只需要在 maven attach artifact plugin 添加一個<classifier>features</classifier>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/feature/feature.xml</file>
<classifier>features</classifier>
<type>xml</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.