New Bee
New Bee

Reputation: 31

What is causing ArtifactNotFoundException in anypoint maven?

I am trying to create new connector using mulesoft sdk. The connector has been successfully created and and loaded into the internal maven repository. When I try to reference the connector in the anypoint project, I get

Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.demo.cloud:mule-connector:pom:1.0.0 in https://maven.anypoint.mulesoft.com/api/v2/maven was cached in the local repository, resolution will not be reattempted until the update interval of anypoint-exchange-v2 has elapsed or updates are forced

When I run the maven cmd in the command line, there are no errors. But as soon as I add dependency in the anypoint project pom file, I get the error. What could be wrong?

Upvotes: 1

Views: 1611

Answers (2)

Thinker-101
Thinker-101

Reputation: 651

I faced similar issue before. I would like to add some extras to the existing answer.

The misuse of classifiers can happen when you try to pull artifacts from maven central without knowing what type of packaging type the artifact is made of during its maven release phase.

mvn release:clean mvn release:prepare mvn release:perform

Observe that when you add something as mule-plugin as a classifier in your dependency. It will add the connector plugin in your mule package explorer on the left hand side. This may not still resolve the pom unavailability problem you have pasted in the question.

I also believe that org.demo.cloud is an groupId not an artifact ID. Nevertheless, your application might not be a true mule-plugin based on its pom declaration.

Try packaging your main APP-1 (in maven central) as a mule-plugin in the APP-1 pom file. If not, simply put the packaging as jar type and republish your artifacts. Later, don't mention the classifier section in your APP-2. Simply call the direct dependency.

Check my other answer in here.:Unable to reference to DWL script files in Mule 4 dataweave from Project Libraries(jar)

Upvotes: 0

aled
aled

Reputation: 25837

It looks like the Mule application project is trying to reference the connector reference with an incorrect Maven classifier. It should be a mule-plugin but the error message implies it is pom.

Example:

<dependency>
    <groupId>org.demo.cloud</groupId>
    <artifactId>mule-connector</artifactId>
    <version>1.0.0</version>
    <classifier>mule-plugin</classifier>
</dependency>

Upvotes: 0

Related Questions