maven-bundle-plugin和maven-assembly-plugin生成的jar有所不同。 具体来说,捆绑插件选择的Bouncycastle版本为1.54,而程序集插件选择的版本为1.6。
这就是我验证观察结果的方式:- 我在pom文件中显式添加了对充气城堡的依赖(1.6版)。生成的罐子相同,但不同。 (所有依赖项都会自动处理,两个jar都没有问题)
依赖性树如下
public List<Pet> toPets(String[] petArray) {
List<Pet> pets = new ArrayList();
for (String petAsString: petArray) {
String[] petParts = petAsString.split(",");
String petName = petParts[0].trim();
String type = petParts[1].trim();
int age = Integer.parseInt(petParts[2].trim());
String ownerName = petParts[3].trim();
Pet pet = new Pet(petName, type, age, ownerName);
pets.add(pet);
}
return pets;
}
pom文件如下:-
[INFO] com.psg.dis.analysis:UnstructuredDataAnalyzer:bundle:9.9.0-SNAPSHOT
[INFO] +- com.psg.dis.platform:IDAPlatform:jar:9.9.0-SNAPSHOT:provided
[INFO] | +- com.psg.dis.platform:Common:jar:9.9.0-SNAPSHOT:provided
[INFO] | | +- com.psg.dis.platform:Policies:jar:9.9.0-SNAPSHOT:provided
[INFO] | | | \- com.psg.services.policies:policies-common:jar:1.0.1:provided
[INFO] | | | \- com.psg.services.policies:policies-client-inf:jar:1.0.1:provided
[INFO] | | | +- com.psg.services.sdk:common-predef:jar:1.0.1:provided
[INFO] | | | +- com.psg.services.sdk:common-api:jar:1.0.1:provided
[INFO] | | | \- com.psg.services.dps:dps-client-inf:jar:1.0.1:provided
[INFO] | | | \- io.projectreactor:reactor-core:jar:3.1.8.RELEASE:provided
[INFO] | | | \- org.reactivestreams:reactive-streams:jar:1.0.2:provided
[INFO] | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.9.3:provided
[INFO] | | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.9.3:provided
[INFO] | | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.9.3:provided
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr353:jar:2.9.3:provided
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.3:provided
[INFO] | | +- org.glassfish:javax.json:jar:1.1.2:provided
[INFO] | | +- javax.json:javax.json-api:jar:1.1.2:provided
[INFO] | | +- javax.ws.rs:javax.ws.rs-api:jar:2.1:provided
[INFO] | | +- org.apache.logging.log4j:log4j-api:jar:2.11.0:provided
[INFO] | | +- org.apache.logging.log4j:log4j-core:jar:2.11.0:provided
[INFO] | | +- org.apache.logging.log4j:log4j-jul:jar:2.11.0:provided
[INFO] | | +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.11.0:provided
[INFO] | | +- org.glassfish.jersey.inject:jersey-hk2:jar:2.26:provided
[INFO] | | | \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b42:provided
[INFO] | | | +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b42:provided
[INFO] | | | +- org.glassfish.hk2:hk2-api:jar:2.5.0-b42:provided
[INFO] | | | | \- javax.inject:javax.inject:jar:1:provided
[INFO] | | | \- org.glassfish.hk2:hk2-utils:jar:2.5.0-b42:provided
[INFO] | | +- commons-cli:commons-cli:jar:1.3.1:provided
[INFO] | | +- org.apache.commons:commons-lang3:jar:3.4:provided
[INFO] | | +- org.glassfish.grizzly:grizzly-http-server:jar:2.4.2:provided
[INFO] | | | \- org.glassfish.grizzly:grizzly-http:jar:2.4.2:provided
[INFO] | | | \- org.glassfish.grizzly:grizzly-framework:jar:2.4.2:provided
[INFO] | | +- org.glassfish.grizzly:grizzly-http-servlet:jar:2.4.2:provided
[INFO] | | +- org.bouncycastle:bcpkix-jdk15on:jar:1.56:compile
感谢您的帮助