title: Deploy springboot executable with Maven to Nexus
body: <p>I'm using Maven to build my executable Spring-Boot and I also use the spring-boot-maven-plugin.</p>
  
  <pre><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.psmonster.wfe&lt;/groupId&gt;
    &lt;artifactId&gt;saxon&lt;/artifactId&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;version&gt;0.1.1&lt;/version&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.1.6.RELEASE&lt;/version&gt;
    &lt;/parent&gt;
  
    &lt;pluginRepositories&gt;
        &lt;pluginRepository&gt;
            &lt;id&gt;maven2&lt;/id&gt;
            &lt;url&gt;https://repo.maven.apache.org/maven2/&lt;/url&gt;
        &lt;/pluginRepository&gt;
    &lt;/pluginRepositories&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&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;dependency&gt;
        &lt;groupId&gt;com.jayway.jsonpath&lt;/groupId&gt;
        &lt;artifactId&gt;json-path&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;javax.xml&lt;/groupId&gt;
        &lt;artifactId&gt;jaxp-api&lt;/artifactId&gt;
        &lt;version&gt;1.4.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;net.sf.saxon&lt;/groupId&gt;
        &lt;artifactId&gt;Saxon-B&lt;/artifactId&gt;
        &lt;version&gt;9.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;io.springfox&lt;/groupId&gt;
        &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
        &lt;version&gt;2.7.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;  
        &lt;groupId&gt;io.springfox&lt;/groupId&gt;
        &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
        &lt;version&gt;2.7.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
        &lt;artifactId&gt;spring-cloud-consul-dependencies&lt;/artifactId&gt;
        &lt;version&gt;1.0.0.RELEASE&lt;/version&gt;
        &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
    &lt;distributionManagement&gt;
      &lt;repository&gt;
        &lt;id&gt;central&lt;/id&gt;
        &lt;name&gt;saxon-releases&lt;/name&gt;
        &lt;url&gt;${env.MAVEN_REPO_URL}/repository/WFESRV/&lt;/url&gt;
      &lt;/repository&gt;
    &lt;/distributionManagement&gt;
  
    &lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
    &lt;/properties&gt;
  
   &lt;build&gt;
      &lt;pluginManagement&gt;
        &lt;plugins&gt;
          &lt;plugin&gt;
             &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
             &lt;version&gt;2.8.1&lt;/version&gt;
             &lt;executions&gt;
                &lt;execution&gt;
                   &lt;id&gt;default-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;/execution&gt;
             &lt;/executions&gt;
          &lt;/plugin&gt;
         &lt;plugin&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.2.2.RELEASE&lt;/version&gt;
          &lt;executions&gt;
           &lt;execution&gt;
            &lt;goals&gt;
             &lt;goal&gt;repackage&lt;/goal&gt;
            &lt;/goals&gt;
           &lt;/execution&gt;
          &lt;/executions&gt;
         &lt;/plugin&gt;
          &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
            &lt;version&gt;3.8.1&lt;/version&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
            &lt;groupId&gt;org.sonarsource.scanner.maven&lt;/groupId&gt;
            &lt;artifactId&gt;sonar-maven-plugin&lt;/artifactId&gt;
            &lt;version&gt;3.7.0.1746&lt;/version&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                &lt;archive&gt;
                  &lt;manifest&gt;
                  &lt;mainClass&gt;base.Application&lt;/mainClass&gt;
                  &lt;/manifest&gt;
                &lt;/archive&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
        &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>When I run this:</p>
  
  <pre><code>mvn  $MAVEN_CLI_OPTS clean package spring-boot:repackage -Dmaven.test.skip=true -q
  </code></pre>
  
  <p>The myPSMonster.jar is build well, and I can run that in my Docker Container.
  So to I just want to push it to my Nexus Artifactory I just add <strong>deploy</strong> after repackage.
  Then the nice jar will be overwritten and a tiny jar with only the compiled code will be pushed.</p>
  
  <p>Does somebody know how to fix this without using deploy:deploy-file?</p>