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

使用Nexus代理仓库执行Maven打包报错,咨询优先排查方向

Troubleshooting Steps for Maven Dependency Resolution Failure with Nexus Proxy Repositories

Based on your error message and configuration details, here are the first critical things you should check to resolve this issue:

  • Verify Maven repository version permissions in settings.xml
    Your current settings.xml only defines repository IDs and URLs, but doesn’t specify which repositories handle release vs snapshot versions. Maven defaults to allowing both unless configured otherwise. Add the <releases> and <snapshots> blocks to enforce correct behavior:

    <repository>
      <id>aliyun_release</id>
      <url>http://192.168.xxx.xxx:8081/repository/aliyun_release/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>aliyun_snapshot</id>
      <url>http://192.168.xxx.xxx:8081/repository/aliyun_snapshot/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    

    This tells Maven to use aliyun_release exclusively for release artifacts and aliyun_snapshot for snapshots, aligning with your Nexus proxy setup.

  • Check Nexus proxy repository version policies
    Log into your Nexus 3.19.1 instance and verify each proxy’s configuration:

    1. Navigate to Repository > Repositories
    2. For aliyun_release, confirm its Version policy is set to Release
    3. For aliyun_snapshot, confirm its Version policy is set to Snapshot
      While the error points to Maven targeting the wrong repository, ensuring Nexus has the correct policy prevents future mismatches.
  • Look for unintended Maven mirror configurations
    Check if your settings.xml includes a <mirrors> section that redirects all requests to aliyun_release. A mirror with <mirrorOf>*</mirrorOf> would force snapshot dependencies to be fetched from the release proxy, triggering the 400 error. Adjust mirrors to exclude snapshot repositories, or create separate mirrors for release and snapshot traffic.

  • Confirm Nexus proxy remote URLs are mapped correctly
    Ensure aliyun_release proxies the original rdc-releases URL (https://repo.rdc.aliyun.com/repository/36007-release-InunWS/), and aliyun_snapshot proxies rdc-snapshots (https://repo.rdc.aliyun.com/repository/36007-snapshot-JRXl8h/). Swapped URLs would cause the release proxy to fetch from a remote snapshot repo (or vice versa), conflicting with Nexus’s version policy.

  • Check project pom.xml for conflicting repository settings
    Some projects define repositories directly in pom.xml. If your riskcontrol-service pom only references aliyun_release, Maven won’t know to look for snapshots in aliyun_snapshot. Ensure the pom inherits settings from settings.xml or explicitly includes both repositories with proper release/snapshot enablement.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.08 19:42:52