This issue occurs when deploying artifacts to Anypoint Exchange, resulting a 401 Unauthorized error. The error is triggered by the failure to transfer the parent-pom artifact, with the specific message: "status code: 401, reason phrase: Unauthorized." This typically points to authentication problems, such as incorrect or missing credentials in the Maven settings.xml file or issues with repository access configurations. The problem may also arise if the appropriate permissions for the targeted repository are not properly set. In this case, the credentials are correct but there is a descrepancy with server ID between the pom.xml and settings.xml.
The root cause of the issue was a discrepancy in the server ID names between the parent POM and the settings.xml file. Specifically, the parent POM was referencing Exchange3 for artifact deployment, while the settings.xml file contained a server ID of Exchange V3. This mismatch led to the 401 Unauthorized error during the deployment process.
To resolve this issue, ensure that the server ID in the settings.xml file matches exactly with the one specified in the parent POM. Once the server ID names are aligned, the authentication error should be resolved, and the deployment to Anypoint Exchange will succeed.
If correcting the server ID names does not work, you can follow the steps in the related article to create a new settings.xml and pom.xml following the template outlined in the article. Additionally, ensure that the settings.xml file is located in the expected directory or that the Maven command is correctly pointing to the custom settings.xml. Even if the settings.xml content is correct, if Maven is unable to locate the file, you will encounter a 401 Unauthorized error.
003962201

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.