我现在正在使用 pax-exam 运行我的 osgi 单元测试。在我正在做的项目中,bundle 之间有很多子模块和依赖关系。现在,我项目中的 bundle 版本是 xxx-SNAPSHOT。我将 pax-exam 配置选项设置为:
options.add(CoreOptions.mavenBundle().groupId("xxx.xxx").artifactId("xxx.xxxx.xxxx.xx").versionAsInProject());
当我运行测试时,pax 将重新下载我的 SNAPSHOT 依赖项,并从我的本地 repo 中读取发布依赖项。并输出以下信息:
[main] INFO org.ops4j.pax.scanner.internal.ProvisionServiceImpl - Scan bundles from [scan-bundle:mvn:commons-lang/commons-lang/2.6]
[main] INFO org.ops4j.pax.scanner.internal.ProvisionServiceImpl - Scan bundles from [scan-bundle:mvn:xxx.xxx/xxx.xxx.xxx/x.x.x-SNAPSHOT@update]
如您所见,pax 将自动更新 SNAPSHOT 依赖项,即使我没有设置依赖项更新策略。 我的问题是:这是 pax 违约行为吗?如何改变这种行为?我不想自动更新 SNAPSHOT 依赖项。