2017-07-13 57 views
0

我正在使用(Maven)依賴項,它本身取決於xml-apis。不幸的是,這個軟件包的存在現在在我們的OSGi環境中引起了衝突(如果它應該是相關的,請參見下面的內容)。xml-apis JAR文件是否必要?

看着JAR的內容,我發現無論如何都會出現在當前JRE中的類。所以,我的問題:是否保存排除這種依賴?

一般來說:有沒有關於過去是獨立依賴的類的官方文檔,現在已經集成到了JRE中?


這裏所提到的OSGi的錯誤時,創建xml-apis束存在:

Bundle was not resolved because of a uses contraint violation. 
    org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource my.company.plugin [osgi.identity; osgi.identity="my.company.plugin"; type="osgi.bundle"; version:Version="2.0.0.201707131542"; singleton:="true"] because it is exposed to package 'javax.xml.transform' from resources org.eclipse.osgi [osgi.identity; type="osgi.bundle"; version:Version="3.11.1.v20160708-1632"; osgi.identity="org.eclipse.osgi"; singleton:="true"] and xml-apis [osgi.identity; type="osgi.bundle"; version:Version="1.4.1.bnd-vA0Q7A"; osgi.identity="xml-apis"] via two dependency chains. 

回答

1

您可以在您的項目與範圍pom.xml中定義了XML的API作爲一個明確的依賴性「提供」。那麼它將不會成爲運行時依賴關係的一部分。

+0

謝謝,我知道如何排除它們。我的問題針對潛在的負面影響。 – qqilihq

+0

由於Java 5 API已經在Java 5中得到認可,因此可以認爲它們是被提供的。我不認爲有人使用JDK <1.5了。 – fhossfel