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.
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.
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

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.