title: MapStruct - Cannot find implementation
body: <p>Using latest Springboot and MapStruct versions and building with Maven, I am trying to implement the "Start Here" example given in <a href="https://mapstruct.org/#get-started" rel="noreferrer">the official MapStruct site</a></p>
  
  <p>My code is even simpler:</p>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;org.mapstruct.version&gt;1.3.1.Final&lt;/org.mapstruct.version&gt;
  
  (...)
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.mapstruct&lt;/groupId&gt;
      &lt;artifactId&gt;mapstruct&lt;/artifactId&gt;
      &lt;version&gt;${org.mapstruct.version}&lt;/version&gt;
  &lt;/dependency&gt;
  
  (...)
  
      &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
              &lt;source&gt;1.8&lt;/source&gt;
              &lt;target&gt;1.8&lt;/target&gt;
              &lt;annotationProcessorPaths&gt;
                  &lt;path&gt;
                      &lt;groupId&gt;org.mapstruct&lt;/groupId&gt;
                      &lt;artifactId&gt;mapstruct-processor&lt;/artifactId&gt;
                      &lt;version&gt;${org.mapstruct.version}&lt;/version&gt;
                  &lt;/path&gt;
              &lt;/annotationProcessorPaths&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  </code></pre>
  
  <p>Car.java</p>
  
  <pre><code>public class Car {
  
      private String model;
  
      // Constructors, setters and getters...
  
  }
  </code></pre>
  
  <p>CarDto.java</p>
  
  <pre><code>public class CarDto {
  
      private String theModel;
  
      // Constructors, setters and getters...
  </code></pre>
  
  <p>}</p>
  
  <p>CarMapper.java interface</p>
  
  <pre><code>@Mapper
  public interface CarMapper {
  
      CarMapper INSTANCE = Mappers.getMapper( CarMapper.class );
  
      @Mapping(source = "model", target = "theModel")
      CarDto carToCarDto(Car car);
  }
  </code></pre>
  
  <p>Main application</p>
  
  <pre><code>@SpringBootApplication
  public class MappertestApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(MappertestApplication.class, args);
  
          Car c = new Car("Volkswagen");
  
          CarDto cdto = CarMapper.INSTANCE.carToCarDto(c);
  
      }
  
  }
  </code></pre>
  
  <p>All the code is in this public repo: <a href="https://github.com/pgbonino/mappertest" rel="noreferrer">https://github.com/pgbonino/mappertest</a></p>
  
  <p>When running, I am getting this error:</p>
  
  <pre><code>Exception in thread "main" java.lang.ExceptionInInitializerError
      at com.gallelloit.mappertest.MappertestApplication.main(MappertestApplication.java:14)
  Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Cannot find implementation for com.gallelloit.mappertest.CarMapper
      at org.mapstruct.factory.Mappers.getMapper(Mappers.java:61)
      at com.gallelloit.mappertest.CarMapper.&lt;clinit&gt;(CarMapper.java:10)
      ... 1 more
  Caused by: java.lang.ClassNotFoundException: Cannot find implementation for com.gallelloit.mappertest.CarMapper
      at org.mapstruct.factory.Mappers.getMapper(Mappers.java:75)
      at org.mapstruct.factory.Mappers.getMapper(Mappers.java:58)
      ... 2 more
  </code></pre>
  
  <p>I found <a href="https://github.com/mapstruct/mapstruct/issues/1812" rel="noreferrer">this issue</a> in the official MapStruct project, which seems to describe the same issue. However, in that case some custom configuration was being performed (custom name of the implementation). In my case everything is left as default.</p>
  
  <p>Any idea?</p>