Why is my pom.xml file getting updated, everytime I'm trying to deploy an application from Anypoint Studio to CloudHub?

104 Views Asked by At

I have the following part in my pom.xml file in for a dummy project that I'm doing:

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>mule-maven-plugin</artifactId>
    <version>${mule.maven.plugin.version}</version>
    <extensions>true</extensions>
    <configuration>
        <classifier>mule-application</classifier>
    </configuration>
</plugin>

Whenever I try to deploy the application to CloudHub directly from my Studio the above part changes to the following part:

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>mule-maven-plugin</artifactId>
    <version>${mule.maven.plugin.version}</version>
    <extensions>true</extensions>
    <configuration>
        <classifier>---- select project type ----</classifier>
    </configuration>
</plugin>

Then the deployment fails with the following error:

Publication status: error
[INFO]   ------------------------------------------------------------
[INFO]     Steps: 
[INFO]     - Description: Publishing asset
[INFO]     - Status: error
[INFO]     - Errors: [The asset is invalid, Error while trying to set type: app. Expected type is: rest-api.]
[INFO]     .........................................
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:33 min
[INFO] Finished at: 2024-01-08T14:11:31+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mule.tools.maven:exchange-mule-maven-plugin:0.0.17:exchange-deploy (default-exchange-deploy) on project super-biodata-sapi: Exchange publication failed: Publication ended with errors: [The asset is invalid, Error while trying to set type: app. Expected type is: rest-api.] -> [Help 1]

What can be the reason for this?

Here are some details: Anypoint Studio Version: 7.16.0 Maven Version: 3.8.8 Mule Runtime Version: 4.4.0 Mule Maven Plugin Version: 3.8.0/4.0.0 (Tried with both) Java Version: OpenJDK 11.0.9

I previously had Anypoint Studio 7.15, I had no issues with the exact same project there. But after updating, I'm facing a plethora of problems.

I also tried using "rest-api" instead of "mule-application". Then first just as the deployment starts, the "rest-api" is changed to "mule-application" which then again changes to "---- select project type ----" and then finally fails.

1

There are 1 best solutions below

0
aled On

I suspect a confusión. You mentioned you are trying to deploy a Mule 4 application to CloudHub but the references to assets and the error message are related to publishing assets to Any point Exchange.

CloudHub is a cloud platform to deploy and execute Mule applications. Anypoint Exchange is a repository for assets, including definitions of REST APIs but not Mule 4 applications and not for executing anything. See the documentation for details on valid assets.

Since mule-application is not a valid asset type to publish to Exchange (for Mule 4) then it would seem that Studio is trying to get you to change to a valid asset type.

If you are instead trying to deploy to CloudHub see the documentation for different methods.