Loading
ただいま大変多くのお問い合わせをいただいており、ご連絡までにお時間を頂戴しております続きを読む

mvn deploy to Exchange fails with 401 Unauthorized or "Artifact could not be resolved" - Connected App credential format in settings.xml

公開日: Jun 24, 2026
説明

PROBLEM

Publishing to Anypoint Exchange via Maven fails with: Exchange publication failed: Artifact could not be resolved or a 401 Unauthorized from the Exchange Maven repository.

ROOT CAUSE

Anypoint Exchange's Maven facade (v3) does not support direct Anypoint Platform username/password authentication when Multi-Factor Authentication (MFA) is enforced on the organization. The Maven client has no mechanism to complete an interactive MFA challenge during a build, so credentials are rejected at the authentication layer before any artifact resolution occurs.

The supported authentication pattern is a Connected App (Client Credentials grant). However, the credentials must be passed in the exact format the Exchange v3 Maven facade expects.

解決策

SOLUTION

In settings.xml, configure the Exchange server with Connected App credentials using the literal username ~~~Client~~~ and formatting the password as clientId~?~clientSecret. Confirm the ID in settings.xml matches the repositoryId in pom.xml.

<server>
      <id>Repository</id>
      <username>yourUserName</username>
      <password>yourPassword</password>
</server>

    to:

<server>
      <id>Repository</id>
      <username>~~~Client~~~</username> 
      <password>clientID~?~clientSecret</password>
 </server>

 

ナレッジ記事番号

005387636

 
読み込み中
Salesforce Help | Article