我有各種自制的項目,有第三方庫依賴項。 我捆綁他們爲OSGI容器,但無法解決我的項目中的深層依賴項。 現在我正在尋找karaf文件夾,我可以放置我的庫,使捆綁可以直接訪問它們,而不是安裝它們。我可以將第三方罐放在karaf(任何特定文件夾)中以解決傳遞性依賴關係嗎?
更多我使用的也是maven。
編輯: 以下的「功能」的解決方案後,我能夠產生明顯的方含傳遞依賴,但現在問題是,它也看起來非常普通的java文件:例如:下面是相當大的依賴列表:
bsh -- Cannot be resolved
com.fasterxml.jackson.annotation -- Cannot be resolved
com.fasterxml.jackson.core -- Cannot be resolved
com.fasterxml.jackson.databind -- Cannot be resolved
com.fasterxml.jackson.databind.annotation -- Cannot be resolved
com.fasterxml.jackson.databind.module -- Cannot be resolved
com.gargoylesoftware.htmlunit -- Cannot be resolved
com.gargoylesoftware.htmlunit.util -- Cannot be resolved
com.google.protobuf -- Cannot be resolved
com.ibm.uvm.tools -- Cannot be resolved
com.ibm.websphere.uow -- Cannot be resolved
com.ibm.wsspi.uow -- Cannot be resolved
com.jamonapi -- Cannot be resolved
com.jamonapi.utils -- Cannot be resolved
com.jayway.jsonpath -- Cannot be resolved
com.jcraft.jzlib -- Cannot be resolved
com.mysema.query.types -- Cannot be resolved
com.sun.javadoc -- Cannot be resolved and overwritten by Boot Delegation
com.sun.jdmk.comm -- Cannot be resolved and overwritten by Boot Delegation
com.sun.net.httpserver -- Cannot be resolved and overwritten by Boot Delegation
com.sun.tools.javadoc -- Cannot be resolved and overwritten by Boot Delegation
com.sun.xml.fastinfoset.sax -- Cannot be resolved and overwritten by Boot Delegation
com.sun.xml.fastinfoset.stax -- Cannot be resolved and overwritten by Boot Delegation
com.typesafe.config -- Cannot be resolved
groovy.lang -- Cannot be resolved
groovy.xml -- Cannot be resolved
javassist -- Cannot be resolved
javax.activation from org.apache.felix.framework (0)
javax.annotation from org.apache.felix.framework (0)
javax.crypto from org.apache.felix.framework (0)
javax.crypto.spec from org.apache.felix.framework (0)
javax.ejb -- Cannot be resolved
javax.el -- Cannot be resolved
javax.enterprise.concurrent -- Cannot be resolved
javax.enterprise.context -- Cannot be resolved
javax.enterprise.context.spi -- Cannot be resolved
javax.enterprise.event -- Cannot be resolved
javax.enterprise.inject -- Cannot be resolved
javax.enterprise.inject.spi -- Cannot be resolved
javax.enterprise.util -- Cannot be resolved
你的意思是我簡單地將我的JAR放入deploy文件夾,我的依賴關係應該解決?但是要告訴你那些JAR還沒有捆綁出來。 – usman
Karaf自動將普通的香草JAR文件轉換爲盡力而爲捆綁jar文件。例如,它不可能推斷出版本。但它會部署jar文件好吧。如果你幸運的話,你的所有依賴關係都將得到解決。另一種方法是使用maven-bundle-plugin來[嵌入](http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html#embedding-dependencies)你所有的非捆綁依賴關係都會放入你自己的捆綁包中。 – Ralf
而不是部署文件夾,我把self-made.jar(我的porject jar1)放在lib文件夾中,並在etc/config.properties中提供包路徑。那麼這樣我的捆綁包就獲得了第一個依賴關係,現在依賴關係在自制的.jar中,它們沒有被解析。這是我的問題的實際點。此外,我正在閱讀功能以及 – usman