0

插件版本:3.3.0

我想知道 maven-bundle-plugin 如何从重复的 Export-Packages 包中解析版本,以下是来自 mvn -X 调试输出,似乎插件正在使用找到的第一个包中的版本。

-------------------------------------------------- ---------------------

[调试] BND 类路径:

-------------------------------------------------- ---------------------

-classpath:\D:\dev\m3repo\io\dropwizard\metrics\metrics-core\3.1.2\metrics-core-3.1.2.jar,\D:\dev\m3repo\com\codahale\metrics\metrics -core\3.0.2\metrics-core-3.0.2.jar

-------------------------------------------------- ---------------------

MANIFEST.MF (io\dropwizard\metrics\metrics-core\3.1.2\metrics-core-3.1.2.jar)

Manifest-Version: 1.0 
Bnd-LastModified: 1430020731305 
Build-Jdk: 1.8.0_05 
Built-By: ryantenney 
Bundle-Description: Metrics is a Java library which gives you unparallel  ed insight into what your code does in        production. Metrics provi  des a powerful toolkit of ways to measure the behavior of critical     
    components in your production environment. 
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.html Bundle-ManifestVersion: 2 
Bundle-Name: Metrics Core 
Bundle-SymbolicName: io.dropwizard.metrics.core 
Bundle-Version: 3.1.2 
Created-By: Apache Maven Bundle Plugin 
Export-Package: com.codahale.metrics;uses:="org.slf4j,javax.management,sun.misc";version="3.1.2"
Implementation-Title: Metrics Core 
Implementation-Vendor-Id: io.dropwizard.metrics 
Implementation-Version: 3.1.2 
Import-Package: javax.management,org.slf4j;version="[1.6.0,2.0.0)",sun.m  isc;resolution:=optional 
Tool: Bnd-1.50.0

MANIFEST.MF (com\codahale\metrics\metrics-core\3.0.2\metrics-core-3.0.2.jar)

Manifest-Version: 1.0 
Bnd-LastModified: 1392597083041 
Build-Jdk: 1.7.0_51 
Built-By: coda 
Bundle-Description: Metrics is a Java library which gives you unparallel  ed insight into what your code does in     production. Metrics provi  des a powerful toolkit of ways to measure the behavior of critical     
    components in your production environment. 
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.html 
Bundle-ManifestVersion: 2 
Bundle-Name: Metrics Core 
Bundle-SymbolicName: com.codahale.metrics.core 
Bundle-Version: 3.0.2 
Created-By: Apache Maven Bundle Plugin 
Export-Package: com.codahale.metrics;uses:="org.slf4j,javax.management,s  un.misc";version="3.0.2" 
Implementation-Title: Metrics Core 
Implementation-Vendor-Id: com.codahale.metrics 
Implementation-Version: 3.0.2 
Import-Package: javax.management,org.slf4j;version="[1.6.0,2.0.0)",sun.m  isc;resolution:=optional 
Tool: Bnd-1.50.0

以及我的捆绑包的最终输出 MANIFEST.MF:

#-----------------------------------------------------------------------

[DEBUG] Final Manifest:
#-----------------------------------------------------------------------
Manifest-Version: 1.0
Bnd-LastModified: 1499834358907
Build-Jdk: 1.8.0_111
Built-By: ys03
Bundle-Description: MyBundle
Bundle-DocURL: http://my.bundle
Bundle-ManifestVersion: 2
Bundle-Name: MyBundle
Bundle-SymbolicName: com.foo.bar.myBundle
Bundle-Vendor: ysw
Bundle-Version: 1.0.0.11
Created-By: Apache Maven Bundle Plugin
Export-Package: com.foo.bar.myBundle;
Implementation-Version: 1.0.0.11 Build: dfaf45de3d27234d42fcc2841e06ccc8
 ed530f18 Timestamp: 2017-07-12 12:39:12
Import-Package:
 com.fasterxml.jackson.databind;version="[2.3.0,3.0.0)",
 org.joda.time.format;version="[2.1.0,3.0.0)",
 com.codahale.metrics;version="[3.1,4)",
 com.google.common.collect;version="[19.0,20)",
 org.apache.commons.codec.binary;version="[1.10,2)",
 org.apache.commons.lang3;version="[3.4,4)",
 org.slf4j;version="[1.7,2)",
Tool: Bnd-3.3.0.201609221906
#-----------------------------------------------------------------------

com.codahale.metrics 的最终版本是[3.1,4),我想应该是[3.0,4),如果我错了,请纠正我的理解。

谢谢。

4

1 回答 1

0

我会说自动化使用您指定的 maven 依赖项,然后继续尝试通过传递依赖项进行解析。那里可能隐藏着需要 3.1 的东西。

于 2018-01-23T09:54:19.070 回答