You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Maven仍指向默认中央仓库,无法拉取指定版本插件求助

解决Maven拉取mule-app-maven-plugin 1.2版本的仓库配置问题

核心原因:依赖仓库与插件仓库的区别

Maven对普通Jar依赖的仓库(<repository>)和Maven插件的仓库(<pluginRepository>)采用独立配置逻辑。你之前仅在settings.xml中配置了普通依赖仓库,Maven拉取插件时仍会默认使用中央仓库,因此需要单独配置插件仓库。

正确的settings.xml配置

在settings.xml的<settings>节点下添加插件仓库配置:

<pluginRepositories>
    <pluginRepository>
        <id>mulesoft-releases</id>
        <name>MuleSoft Releases Repository</name>
        <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
        <layout>default</layout>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

可选:覆盖默认中央插件仓库

如果希望所有插件优先从Mulesoft仓库拉取,可直接覆盖中央插件仓库的配置,添加到上述<pluginRepositories>节点中:

<pluginRepository>
    <id>central</id>
    <name>Mule Repo Central Override</name>
    <url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
</pluginRepository>

额外排查步骤

  • 清理本地Maven仓库缓存:删除本地仓库中该插件的缓存目录~/.m2/repository/org/mule/tools/maven/mule-app-maven-plugin/1.2,避免缓存干扰拉取逻辑。
  • 检查项目pom.xml:确认项目自身未配置<pluginRepositories>节点覆盖全局设置,若存在冲突需调整pom中的配置。

内容的提问来源于stack exchange,提问作者Tomas Breuer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 11:08:23