title: The requested profile "docker" could not be activated because it does not exist
body: <p>I have a simple Spring boot application for which I want to build docker image using Jenkins but getting error :</p>
  <p>Jenkins Error:</p>
  <pre><code>    + /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/M3/bin/mvn clean package -DreleaseVersion=main.39.4c278b3.102 -DdevelopmentVersion=0.0.1-SNAPSHOT -DskipTests -Pdocker docker:push
  [INFO] Scanning for projects...
  Progress (2): 20 kB | 14 kB   
                             
  Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (14 kB at 37 kB/s)
  Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 kB at 54 kB/s)
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  1.200 s
  [INFO] Finished at: 2021-04-16T06:21:07Z
  [INFO] ------------------------------------------------------------------------
  [WARNING] The requested profile &quot;docker&quot; could not be activated because it does not exist.
  [ERROR] No plugin found for prefix 'docker' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/var/lib/jenkins/.m2/repository), central (https://repo.maven.apache.org/maven2)] -&gt; [Help 1]
  [ERROR] 
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
  [Pipeline] }
  [Pipeline] // dir
  [Pipeline] }
  [Pipeline] // node
  [Pipeline] End of Pipeline
  ERROR: script returned exit code 1
  Finished: FAILURE
  </code></pre>
  <p>My pom.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.4.4&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.pomelo&lt;/groupId&gt;
      &lt;artifactId&gt;Pomelo-Assignment&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;Pomelo-Assignment&lt;/name&gt;
      &lt;description&gt;Pomelo project for Spring Boot assignment&lt;/description&gt;
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
        
  &lt;/project&gt;
  </code></pre>
  <p>My Jenkins File:</p>
  <pre><code>node {......
      dir('App') {
          stage 'Build docker image'
          def pom = readMavenPom file: 'pom.xml'
          def v = version()
          sh &quot;${mvnHome}/bin/mvn clean package -DreleaseVersion=${v} -DdevelopmentVersion=${pom.version} -DskipTests -Pdocker docker:push&quot;
      }
  }
  def version() {
    sh('git rev-parse --abbrev-ref HEAD &gt; GIT_BRANCH')
    sh('git describe --long --tags --dirty --always &gt; GIT_COMMIT')
    sh('git rev-list HEAD | wc -l &gt; GIT_LOG_NO')
  
    def branch = readFile('GIT_BRANCH').trim();
    def hash = readFile('GIT_COMMIT').trim();
    def number = readFile('GIT_LOG_NO').trim();
    &quot;${branch}.${number}.${hash}.${currentBuild.number}&quot;
  }
  </code></pre>