Skip to content
Latchkey

Nexus "PUT ... 405 Method Not Allowed" deploying to a group/proxy in CI

Nexus group and proxy repositories are read-only aggregations. A PUT to them returns 405 Method Not Allowed. Deploys must target a hosted repository; use the group only for resolving dependencies.

What this error means

The deploy PUT fails with "status code: 405, reason phrase: Method Not Allowed" even though the same URL works fine for downloads and dependency resolution.

Nexus
[ERROR] Failed to deploy artifacts: Could not transfer artifact
com.example:app:jar:1.2.0 from/to nexus
(https://nexus.example.com/repository/maven-public/): status code: 405,
reason phrase: Method Not Allowed (405)

Common causes

Deploying to a group repository

maven-public (and similar group repos) merge several repos for reads only. They cannot accept writes, so PUT returns 405.

Deploying to a proxy repository

Proxy repos mirror an upstream and are read-only. Uploads to them are rejected with 405 the same way.

How to fix it

Deploy to a hosted repository

  1. Resolve dependencies from the group repo (maven-public).
  2. Deploy artifacts to a hosted repo (maven-releases or maven-snapshots).
  3. Never point distributionManagement at a group or proxy URL.
pom.xml
<!-- reads from the group, writes to hosted -->
<repositories>
  <repository>
    <id>nexus</id>
    <url>https://nexus.example.com/repository/maven-public/</url>
  </repository>
</repositories>
<distributionManagement>
  <repository>
    <id>nexus</id>
    <url>https://nexus.example.com/repository/maven-releases/</url>
  </repository>
</distributionManagement>

Check the repository type in Nexus

In Nexus the repositories list shows Type = group / proxy / hosted. Only hosted accepts deploys.

How to prevent it

  • Use group repos for reads, hosted repos for writes.
  • Verify the target repository Type is hosted before deploying.
  • Keep resolve and deploy URLs distinct in your build config.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →