0

我有一个在 IBM Was 上运行的应用程序。这是一个 maven 项目,在它的依赖树上有一些是运行时依赖,但它们的范围是系统。

这些系统范围 jars 不存在于 .m2/repository 或我们的本地关系中。但我可以在本地环境中编译项目(mvn clean install)。无论如何,maven 可以找到这些罐子。

[INFO] |  |  +- com.ibm.was:was-server-runtime-lib:pom:7.0.0:provided
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.wccm:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.emf:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:j2ee:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:mail-impl:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.runtime:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.ejbportable:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.admin.core:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.admin.services:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.portletcontainer:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:bootstrap:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.sib.server:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.sip.container:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.sip.interface:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.webcontainer:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:marshall:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:ffdcSupport:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:wsatlib:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.runtime.dist:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.mq:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.mq.headers:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.mq.pcf:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.mq.jmqi:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.mq.connector:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.mq.commonservices:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:dhbcore:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:org.eclipse.emf.common:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:org.eclipse.emf.commonj.sdo:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:org.eclipse.emf.ecore.change:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:org.eclipse.emf.ecore.sdo:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:org.eclipse.emf.ecore.xmi:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:org.eclipse.emf.ecore:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.prereq.wsdl4j:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.jaxb.tools:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.jaxws.tools:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.wsfp.main:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.prereq.vajava:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:rsadbutils:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.jpa:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.prereq.commonj-twm:jar:7.0.0:system
[INFO] |  |  |  +- com.ibm.websphere.application.server.v7.0:com.ibm.ws.prereq.soap:jar:7.0.0:system
[INFO] |  |  |  \- com.ibm.websphere.application.server.v7.0:com.ibm.mqjms:jar:7.0.0:system

但是,在构建服务器上找不到这些 jar 并发生以下错误。

The following artifacts could not be resolved: com.ibm.websphere.application.server.v7.0:com.ibm.ws.wccm:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.emf:jar:7.0.0, com.ibm.websphere.application.server.v7.0:j2ee:jar:7.0.0, com.ibm.websphere.application.server.v7.0:mail-impl:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.runtime:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.ejbportable:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.admin.core:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.admin.services:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.portletcontainer:jar:7.0.0, com.ibm.websphere.application.server.v7.0:bootstrap:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.sib.server:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.sip.container:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.sip.interface:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.webcontainer:jar:7.0.0, com.ibm.websphere.application.server.v7.0:marshall:jar:7.0.0, com.ibm.websphere.application.server.v7.0:ffdcSupport:jar:7.0.0, com.ibm.websphere.application.server.v7.0:wsatlib:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.runtime.dist:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.mq:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.mq.headers:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.mq.pcf:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.mq.jmqi:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.mq.connector:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.mq.commonservices:jar:7.0.0, com.ibm.websphere.application.server.v7.0:dhbcore:jar:7.0.0, com.ibm.websphere.application.server.v7.0:org.eclipse.emf.common:jar:7.0.0, com.ibm.websphere.application.server.v7.0:org.eclipse.emf.commonj.sdo:jar:7.0.0, com.ibm.websphere.application.server.v7.0:org.eclipse.emf.ecore.change:jar:7.0.0, com.ibm.websphere.application.server.v7.0:org.eclipse.emf.ecore.sdo:jar:7.0.0, com.ibm.websphere.application.server.v7.0:org.eclipse.emf.ecore.xmi:jar:7.0.0, com.ibm.websphere.application.server.v7.0:org.eclipse.emf.ecore:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.prereq.wsdl4j:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.jaxb.tools:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.jaxws.tools:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.wsfp.main:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.prereq.vajava:jar:7.0.0, com.ibm.websphere.application.server.v7.0:rsadbutils:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.jpa:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.prereq.commonj-twm:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.ws.prereq.soap:jar:7.0.0, com.ibm.websphere.application.server.v7.0:com.ibm.mqjms:jar:7.0.0: Could not find artifact com.ibm.websphere.application.server.v7.0:com.ibm.ws.wccm:jar:7.0.0 at specified path C:\..\com.ibm.ws.wccm.jar -> [Help 1]
4

1 回答 1

0

系统范围依赖项不会从 nexus 存储库下载。它们应该存在于 pom 文件中指定的系统中。我已经意识到 pom 文件中有一些系统路径,并且 releted jar 应该存在于这个文件夹中。为了解决这个问题,我在完全相同的位置创建了一个文件夹,并将所有相关的 jar 复制到这个文件夹中。之后,我能够编译项目。

系统范围依赖的示例 pom 文件内容,对于此示例,缺少的 jar 应复制到 c:\SharedSystemLib。就这样。

<dependency>
    <groupId>${groupId}</groupId>
    <artifactId>com.ibm.ws.wccm</artifactId>
    <version>${version}</version>
    <scope>system</scope>
    <systemPath>c:\SharedSystemLib</systemPath>
</dependency>
于 2017-07-09T12:48:39.770 回答