When deploying an application to Exchange on setting v3 in the Maven Repository url an error is faced:
Url is passed as:
<repository> <id>Repository</id> <name>Corporate Repository</name> <url>https://maven.anypoint.mulesoft.com/api/v3/organizations/YOUR-ORGANISATION-ID/maven</url> <layout>default</layout> </repository>
The below error is faced:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project cloudhub-deploy: Failed to deploy artifacts: Could not transfer artifact Your-Organization-ID:cloudhub-deploy:pom:1.0.2 from/to Repository (https://maven.anypoint.mulesoft.com/api/v3/organizations/Your-Organization-ID/maven): transfer failed for https://maven.anypoint.mulesoft.com/api/v3/organizations/Your-Organization-ID/maven/Your-Organization-ID/cloudhub-deploy/1.0.2/cloudhub-deploy-1.0.2.pom, status: 412 Precondition Failed -> [Help 1]
If the build fails during the deploy stage with a status code of 412 (Precondition Failed), then <goal>exchange-pre-deploy</goal> was not executed.
SOLUTION
There are 2 possibles solutions:
1) To fix this error, do ensure that goal is set inside the executions section of the plugin.
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>exchange-mule-maven-plugin</artifactId>
<version>0.0.13</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>exchange-pre-deploy</goal>
</goals>
</execution>
<execution>
<id>deploy</id>
<phase>deploy</phase>
<goals>
<goal>exchange-deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
2) If the first option does not work, remove the exchange-mule-maven-plugin ( if it was added), then check if you have defined the maven-deploy-plugin in the plugins section, and remove that plugin.
Refer to the help link - Publish a Custom Asset
001120384

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.