Deployment issue on an on premise cluster with Maven arm Deployment - Mule 4.4.0

247 Views Asked by At

I am trying to deploy a Mule application to On prem using Maven, but when i execute the command, the result it's a error, could you please told me if anyone know what can i do to solve this problem:

Command:

mvn clean deploy -DmuleDeploy -Dclustername="" -Dusername="" -Dpassword=""

NOTE: clear the parameters shown above in the command...

Message Issue:

Unauthorized Access. Please verify that authToken is valid

Log Maven:

Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.8.0:deploy (default- 
deploy) on project mulesoft-cicd-pipeline: Execution default-deploy of goal 
org.mule.tools.maven:mule-maven-plugin:3.8.0:deploy failed: Unauthorized Access. Please 
verify that authToken is valid.

POM File - Build Section:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <version>3.2.0</version>
        </plugin>
        <plugin>
            <groupId>org.mule.tools.maven</groupId>
            <artifactId>mule-maven-plugin</artifactId>
            <version>${mule.maven.plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
                <armDeployment>
                  <muleVersion>4.4.0</muleVersion>
                  <uri>https://anypoint.mulesoft.com</uri>
                  <target>${clustername}</target>
                  <targetType>cluster</targetType>
                  <username>${username}</username>
                  <password>${password}</password>
                  <environment>Staging</environment>
                </armDeployment>
            </configuration>
        </plugin>
    </plugins>
</build>

NOTE: I am using my Anypoint Platform username and password, have access to the cluster but have two-step authorization enabled...

If someone can help me I would appreciate it very much...

1

There are 1 best solutions below

0
On

You cannot use your user credentials with MFA enabled. Instead use a connected app. It is described in the documentation: https://docs.mulesoft.com/mule-runtime/4.4/deploy-on-premises#authentication-methods