azuremavenazure-devopsmulesoftcloudhub

Deploying Mule application on Cloud Hub, using Azure Devops


I am trying to deploy my mule application build on anypoint studio, to cloud hub via Azure Devops. To do so I am doing the following:

  1. Created a repository on azure and upload the mulesoft application files on it. (success)
  2. Started a runtime server from cloud hub using mulesoft stand alone runtime on my device(via cmd). (success)
  3. create a secure file and upload setting.xml to it so that it could be used to create the pipeline.(could'nt find setting.xml file)

Hence I am not able to create the pipeline I tried uploading an setting.xml file using the following script, but maven pom.xml throws error for it:

<server>
        <id>Exchange2</id>
        <username>guest-mule</username>
        <password>Mulesoft1</password>
    </server>
    <id>Mule</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <repositories>
        <repository>
            <id>Exchange2</id>
            <name>Exchange2</name>
            <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
            </releases>
                       <snapshots>
                <enabled>true</enabled>
           </snapshots>
        </repository>
    </repositories>
</profile>

Where to find the setting.xml file I tried searching it in .m2 folder in my system (also enabling the hidden items option)


Solution

  • By default, the .m2 folder is in users folder, such as c:\Users\xxx\.m2. But it is not required, so it is make sense that there isn't .m2 folder in your system.

    You could create it manually: Missing maven .m2 folder

    After that you could upload this settings.xml file to Azure DevOps as secure file, then add Download Secure File task to your Azure DevOps pipeline. Then the file will be download to temp folder ($(Agent.TempDirectory)) during build/release.

    You could specify settings.xml file for mvn commmand (-s or --settings ), more information, please call mvn --help to check detail options.

    If you are using Maven task in your Azure DevOps pipeline, you could specify settings.xml file path (in temp folder) in Options box.