title: Azure pipeline for Maven error Unknown lifecycle phase "Dmaven.repo.local
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
      &lt;artifactId&gt;clx-salesforceupsert-ifa&lt;/artifactId&gt;
      &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;mule-application&lt;/packaging&gt;
  
      &lt;name&gt;clx-salesforceupsert-ifa&lt;/name&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
  
          &lt;app.runtime&gt;4.4.0-20220221&lt;/app.runtime&gt;
          &lt;mule.maven.plugin.version&gt;3.5.4&lt;/mule.maven.plugin.version&gt;
      &lt;/properties&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.0&lt;/version&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.mule.tools.maven&lt;/groupId&gt;
                  &lt;artifactId&gt;mule-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${mule.maven.plugin.version}&lt;/version&gt;
                  &lt;extensions&gt;true&lt;/extensions&gt;
                  &lt;configuration&gt;
                  &lt;cloudHubDeployment&gt;
                  &lt;uri&gt;https://anypoint.mulesoft.com&lt;/uri&gt;
                  &lt;server&gt;${server}&lt;/server&gt;
                  &lt;muleVersion&gt;${app.runtime}&lt;/muleVersion&gt;
                  &lt;applicationName&gt;${app.name}&lt;/applicationName&gt;
                  &lt;workers&gt;${workers}&lt;/workers&gt;
                  &lt;workerType&gt;${workerType}&lt;/workerType&gt;
                  &lt;environment&gt;${environment}&lt;/environment&gt;
                  &lt;objectStoreV2&gt;true&lt;/objectStoreV2&gt;
                  
                  &lt;/cloudHubDeployment&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;deploy&lt;/id&gt;
                          &lt;phase&gt;deploy&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;deploy&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;classifier&gt;mule-application&lt;/classifier&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mule.connectors&lt;/groupId&gt;
              &lt;artifactId&gt;mule-http-connector&lt;/artifactId&gt;
              &lt;version&gt;1.6.0&lt;/version&gt;
              &lt;classifier&gt;mule-plugin&lt;/classifier&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.mule.connectors&lt;/groupId&gt;
              &lt;artifactId&gt;mule-sockets-connector&lt;/artifactId&gt;
              &lt;version&gt;1.2.2&lt;/version&gt;
              &lt;classifier&gt;mule-plugin&lt;/classifier&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;anypoint-exchange-v3&lt;/id&gt;
              &lt;name&gt;Anypoint Exchange&lt;/name&gt;
              &lt;url&gt;https://maven.anypoint.mulesoft.com/api/v3/maven&lt;/url&gt;
              &lt;layout&gt;default&lt;/layout&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;mulesoft-releases&lt;/id&gt;
              &lt;name&gt;MuleSoft Releases Repository&lt;/name&gt;
              &lt;url&gt;https://repository.mulesoft.org/releases/&lt;/url&gt;
              &lt;layout&gt;default&lt;/layout&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;mulesoft-releases&lt;/id&gt;
              &lt;name&gt;MuleSoft Releases Repository&lt;/name&gt;
              &lt;layout&gt;default&lt;/layout&gt;
              &lt;url&gt;https://repository.mulesoft.org/releases/&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
  
  &lt;/project&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>above is the pom.xml while trying to run azure pipeline for mule application</p>
  <p>below is the azure-pipelines.yaml</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code># Starter pipeline
  # Start with a minimal pipeline that you can customize to build and deploy your code.
  # Add steps that build, run tests, deploy, and more:
  # https://aka.ms/yaml
  
  trigger:
  - master
  
  pool:
    vmImage: ubuntu-latest
  variables:
  - group: Build-Variable-Group
  - name: MAVEN_CACHE_FOLDER
    value: $(pipeline.workspace)/.m2/repository
  - name: MAVEN_OPTS
    value: 'Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
  
  
  steps:
  
  - task: Cache@1
    inputs:
      key: pom.xml
      path: $(MAVEN_CACHE_FOLDER)
    displayName: Cache Maven Repo
  
  - task: DownloadSecureFile@1
    name: settingsxml
    inputs:
      secureFile: 'settings.xml'
  
  - task: Powershell@2
    inputs:
      targetType: 'inline'
      script: |
          New-Item -Type Directory -Force "${HOME}/.m2"
          Copy-Item -Force "$(settingsxml.secureFilePath)" "${HOME}/.m2/settings.xml"
          
          
  
  - task: Maven@3
    inputs:
      mavenPomFile: 'pom.xml'
      mavenOptions: '-Xmx3072m'
      jdkVersionOption: '17.0.3'
      jdkArchitectureOption: 'x64'
      mavenAuthenticateFeed: true
      publishJUnitResults: false
      javaHomeOption: 'JDKVersion'
      mavenVersionOption: 'Default'
      effectivePomSkip: true
      goals: 'clean install package deploy $(MAVEN_OPTS) -DmuleDeploy -Dserver=$(server) Denvironment=$(environment) -Dworkers=$(workers) -DworkerType=$(workerType) -Dapp.runtime=$(app.runtime) -Dapp.name=$(app.name)'
    
    
  - task: PublishBuildArtifacts@1
    inputs:
      PathtoPublish: '$(Build.ArtifactStagingDirectory)'
      ArtifactName: 'drop'
      publishLocation: 'Container'
  - task: PublishPipelineArtifact@1
    inputs:
      targetPath: '$(Pipeline.Workspace)'
      publishLocation: 'pipeline'</code></pre>
  </div>
  </div>
  </p>
  <p>but while running getting the below error</p>
  <pre><code>[ERROR] Unknown lifecycle phase &quot;Dmaven.repo.local=/home/vsts/work/1/.m2/repository&quot;. You must specify a valid lifecycle phase or a goal in the format &lt;plugin-prefix&gt;:&lt;goal&gt; or &lt;plugin-group-id&gt;:&lt;plugin-artifact-id&gt;[:&lt;plugin-version&gt;]:&lt;goal&gt;. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -&gt; [Help 1]
  </code></pre>