我正在关注Modular Java中的示例,但我遇到第6章的问题,并将Spring DM模块添加到我的项目中。
我跑:
pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.2 -- -DwidenScope -DimportTransitive
运行pax-provision时,Spring DM捆绑包无法解析。我收到有关从spring.osgi.extender和其他两个未解析的包中丢失导入包的投诉。我的配置包列表如下所示:
0 ACTIVE org.eclipse.osgi_3.5.0.v20090520 1 ACTIVE org.eclipse.osgi.util_3.2.0.v20090520-1800 2 ACTIVE org.eclipse.osgi.services_3.2.0.v20090520-1800 3 ACTIVE org.ops4j.pax.logging.pax-logging-api_1.3.0 4 ACTIVE org.ops4j.pax.logging.pax-logging-service_1.3.0 5 INSTALLED org.springframework.osgi.extender_1.2.0 6 INSTALLED org.springframework.osgi.core_1.2.0 7 INSTALLED org.springframework.osgi.io_1.2.0 8 ACTIVE com.springsource.slf4j.org.apache.commons.logging_1.5.0 9 ACTIVE com.springsource.slf4j.api_1.5.0 Fragments=10 10 RESOLVED com.springsource.slf4j.log4j_1.5.0 Master=9 11 ACTIVE com.springsource.org.aopalliance_1.0.0 12 ACTIVE com.springsource.edu.emory.mathcs.backport_3.1.0 13 ACTIVE com.springsource.org.apache.log4j_1.2.15 14 ACTIVE com.springsource.javax.jms_1.1.0 15 ACTIVE com.springsource.javax.mail_1.4.0 16 ACTIVE com.springsource.javax.transaction_1.1.0 17 ACTIVE com.springsource.javax.activation_1.1.0
diag 5
给出以下输出:
initial@reference:file:../bundles/org.springframework.osgi.extender_1.2.0.jar/ [5] Direct constraints which are unresolved: Missing imported package org.springframework.beans_[2.5.6,4.0.0). Missing imported package org.springframework.beans.factory_[2.5.6,4.0.0). Missing imported package org.springframework.beans.factory.config_[2.5.6,4.0.0). Missing imported package org.springframework.beans.factory.xml_[2.5.6,4.0.0). Missing imported package org.springframework.context_[2.5.6,4.0.0). Missing imported package org.springframework.context.event_[2.5.6,4.0.0). Missing imported package org.springframework.core_[2.5.6,4.0.0). Missing imported package org.springframework.core.enums_[2.5.6,4.0.0). Missing imported package org.springframework.core.io_[2.5.6,4.0.0). Missing imported package org.springframework.core.task_[2.5.6,4.0.0). Missing imported package org.springframework.osgi_[1.2.0,1.2.0]. Missing imported package org.springframework.osgi.context_[1.2.0,1.2.0]. Missing imported package org.springframework.osgi.context.event_[1.2.0,1.2.0]. Missing imported package org.springframework.osgi.context.support_[1.2.0,1.2.0]. Missing imported package org.springframework.osgi.extensions.annotation_[1.2.0,1.2.0]. Missing imported package org.springframework.osgi.service.importer_[1.2.0,1.2.0]. Missing imported package org.springframework.osgi.service.importer.event_[1.2.0,1.2.0]. Missing imported package org.springframework.osgi.service.importer.support_[1.2.0,1.2.0]. Missing imported package org.springframework.osgi.util_[1.2.0,1.2.0]. Missing imported package org.springframework.scheduling.timer_[2.5.6,4.0.0). Missing imported package org.springframework.util_[2.5.6,4.0.0). ...
答案 0 :(得分:2)
问题是缺少存储库和错误版本的工件(1.2.0而不是1.2)的组合。
pax-add-repository -i springsource-repository-release -u http://repository.springsource.com/maven/bundles/release pax-add-repository -i springsource-repository-external -u http://repository.springsource.com/maven/bundles/external pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.2 -- -DwidenScope -DimportTransitive
解决了问题。