【问题标题】:Maven could not resolve dependency of WebSphere provided dependencyMaven 无法解析 WebSphere 提供的依赖项的依赖项
【发布时间】:2019-03-23 04:18:54
【问题描述】:

我正在尝试在 IntelliJ 上导入旧版应用程序,并且大多数模块都依赖于 com.ibm.tools.target.was 和 com.ibm.tools.target.portal 工件。

我在 IntelliJ 的 Maven 窗口中得到这个:

这是我在 mvn install 上收到的错误消息:

无法在项目 xxx-managers 上执行目标:无法解析项目 com.xxx.xxx.xxx-managers:xxx-managers:ejb:0.0.1-SNAPSHOT 的依赖关系:找不到 com.ibm.tools。 http://repo.maven.apache.org/maven2 中的 target:was:pom:8.0.0 已缓存在本地存储库中,直到 Central 的更新间隔已过或强制更新后才会重新尝试解析

我尝试模仿在 IBM 网络知识中心 (https://www.ibm.com/support/knowledgecenter/en/SSHR6W/com.ibm.websphere.wdt.doc/topics/install_server_apis.html) 中找到的类似程序,但没有成功。

我将 was_public.pom 添加为 maven 项目,并将该项目作为依赖项导入到我的其他模块。

我还尝试将 WebSphere 添加为库依赖项:

没有任何效果。

请帮忙,在此先感谢。 编辑:这是我的 settings.xml(我从应用程序工作的其他环境复制它),它包括 IBM 存储库:

    <?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <profiles>
    <profile>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <releases>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
          </snapshots>
          <id>ibm-maven-repo</id>
          <name>ibm-maven-repo</name>
          <url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <releases>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
            <updatePolicy>never</updatePolicy>
          </snapshots>
          <id>ibm-maven-repo</id>
          <name>ibm-maven-repo</name>
          <url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
        </pluginRepository>
      </pluginRepositories>
      <id>standard-extra-repos</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>standard-extra-repos</activeProfile>
  </activeProfiles>
</settings>

【问题讨论】:

标签: maven deployment websphere


【解决方案1】:

您错过了一些工件,例如com.ibm.tools.target:was:pom:8.0.0,您需要在 settings.xml 中指定一个存储库,它应该来自哪里,或者将这些工件安装到您的本地存储库中。

【讨论】:

  • 我在原始帖子中包含了我的 settings.xml。似乎它已经指定了存储库。什么都没有改变,问题仍然存在。在 Maven 存储库中找不到这些工件。
  • 您是否在 ibm 存储库中检查了您错过的工件确实存在?
  • 感谢您的回复。存储库存在但仅包含 xml 和 pom 文件而不是 jar。问题是,在该项目运行的另一台 PC 中,我的 m2 存储库文件夹是相似的。那里也没有jar文件。我想知道这些依赖项是否应该由应用程序服务器以某种方式提供。无论如何,问题仍然存在。
  • 您缺少的依赖项是 pom,因此不需要 jar 文件。问题是存储库是否真的包含所有 poms/jars/您引用的任何内容。
  • 存储库包含 pom 文件,它们也存在于我的 .m2 中。一切似乎都已正确下载到我的 .m2 中,但无法构建项目。
猜你喜欢
  • 2017-05-06
  • 1970-01-01
  • 2014-05-03
  • 1970-01-01
  • 2017-03-03
  • 2011-08-01
  • 1970-01-01
  • 2018-02-27
  • 1970-01-01
相关资源
最近更新 更多