【问题标题】:Unable to load the mojo 'war' in the plugin无法在插件中加载 mojo \'war\'
【发布时间】:2022-08-24 02:33:04
【问题描述】:

我已经通过 maven 配置了我的 pom.xml 中的所有依赖项。当我给出命令构建时,我收到以下错误

[错误] 未能执行目标 org.apache.maven.plugins:maven-war-plugin:2.4:war (default-war) on 项目 nwt_thp_api_br_be-web: 执行 default-war of 目标 org.apache.maven.plugins:maven-war-plugin:2.4:war 失败:无法 在插件中加载 mojo \'war\' \'org.apache.maven.plugins:maven-war-plugin:2.4\' 由于 API 不兼容: org.codehaus.plexus.component.repository.exception.ComponentLookupException: 无效的

我该如何解决这个问题?

  • 您应该使用更新版本的 maven-war-plugin maven.apache.org/plugins
  • 同意 khmarbaise,您应该升级您的“war-plugin”并保留最新版本的 Java。在我的情况下(使用 Java 17)我从 maven-war-plugin 2.1.1 切换到 3.3.2 并且它工作正常。

标签: java maven pom.xml


【解决方案1】:

我已修复:我将 JDK 的版本更改为 1.8 并正确指向 settings.xml。之后,我进行了 maven 更新,然后进行了 maven 构建,它工作了。

【讨论】:

    猜你喜欢
    • 2011-07-21
    • 2012-01-25
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    • 2019-04-12
    • 1970-01-01
    • 2020-03-27
    • 2017-06-21
    相关资源
    最近更新 更多