title: Failed to execute goal com.spotify:dockerfile-maven-plugin:1.3.6:build on project 'foo': Could not build image:
body: <p>We working in small team of 4 people. We using docker to deploy our services. One of the services is a java Spring Boot project which is deployed after building docker image with maven. To make docker image of Spring Boot service we use <code>mvn clean package dockerfile:build</code>.</p>
  
  <p>The fun part is that my colleagues have no problem building docker image of Spring Boot service. And I get maven error message:</p>
  
  <pre><code>[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.3.6:build (default-cli) on project 'foo': Could not build image: com.spotify.docker.client.shaded.com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.spotify.docker.client.messages.RegistryAuth: no String-argument constructor/factory method to deserialize from String value ('osxkeychain')
  </code></pre>
  
  <p>I tried to remove all maven repositories from <code>.m2/repository</code>, restart docker, and remove all images.</p>
  
  <p>Later I tried to run <code>mvn clean package dockerfile:build</code> in to two separate commands:</p>
  
  <ul>
  <li><code>mvn package</code>, then</li>
  <li><code>mvn docker:build</code></li>
  </ul>
  
  <p><code>mvn package</code> passed, and <code>mvn docker:build</code> failed with the same error as shown above.</p>
  
  <p>Maven version <code>3.5.4</code>,
  Docker version <code>18.06.1-ce, build e68fc7a</code>,
  OS: macOS mojave</p>
  
  <p>I even tried to restart my PC hoping that it will fix it...</p>
  
  <p>Edited:
  Here is the maven pom plugin <code>dockerfile-maven-plugin</code></p>
  
  <pre><code>...
  &lt;plugin&gt;
      &lt;groupId&gt;com.spotify&lt;/groupId&gt;
      &lt;artifactId&gt;dockerfile-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.3.6&lt;/version&gt;
      &lt;configuration&gt;
          &lt;repository&gt;${project.artifactId}&lt;/repository&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  ...
  </code></pre>
  
  <p>Edit 2:</p>
  
  <p>Full error message:</p>
  
  <pre><code>[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.3.6:build (default) on project spring-boot-service: Could not build image: com.spotify.docker.client.shaded.com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.spotify.docker.client.messages.RegistryAuth: no String-argument constructor/factory method to deserialize from String value ('swarm')
  [ERROR]  at [Source: N/A; line: -1, column: -1] (through reference chain: java.util.LinkedHashMap["stackOrchestrator"])
  [ERROR] -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>Edit 3:</p>
  
  <p>docker-compose.yml</p>
  
  <pre><code>wrapper:
    image: spring-boot-service:latest
  ports:
    - "8080:8080"
  expose:
    - "8080"
  links:
    - db
    - another-service
  </code></pre>
  
  <p>Solved:</p>
  
  <p>In my case it was wrong version of <code>dockerfile-maven-plugin</code>. I used <code>1.3.6</code>, and <code>1.4.7</code> fixed the problem. </p>
  
  <p>Thanks to <a href="https://stackoverflow.com/users/3301492/boris">Boris</a>!</p>
  
  <p>Update: One more thing!</p>
  
  <p>Make sure when <code>mvn</code> finish build naming is correct, for example:</p>
  
  <pre><code>[INFO] Successfully built **spring-boot-service:0.0.1-SNAPSHOT**
  </code></pre>
  
  <p>And <code>docker-compose.yml</code> should look like this:</p>
  
  <pre><code>...
  wrapper:
    image: **spring-boot-service:0.0.1-SNAPSHOT**
  ...
  </code></pre>