title: I can't add mapstruct in my Spring project
body: <p>I try to add mapstruct mapper in my Spring project.</p>
  
  <p>I have a User entity. I need to show a list of users in the admin panel. For this, I did DTO UserForAdmin, mapper UserMapper and rest controller AdminRestController. When I try to get UserMapper I get errors.</p>
  
  <p>I try two ways:</p>
  
  <ol>
  <li>Mappers.getMapper(UserMapper.class)</li>
  </ol>
  
  <p>I get error </p>
  
  <blockquote>
    <p>java.lang.ClassNotFoundException: Cannot find implementation for
    ru.project.mapper.UserMapper</p>
  </blockquote>
  
  <ol start="2">
  <li>Autowired</li>
  </ol>
  
  <p>I get error</p>
  
  <blockquote>
    <p>Error starting ApplicationContext. To display the conditions report
    re-run your application with 'debug' enabled. 2019-07-17 15:47:07.886
    ERROR 13652 --- [  restartedMain]
    o.s.b.d.LoggingFailureAnalysisReporter   : </p>
    
    <p>*************************** APPLICATION FAILED TO START</p>
    
    <hr>
    
    <p>Description:</p>
    
    <p>Field userMapper in ru.project.controller.rest.AdminRestController
    required a bean of type 'ru.project.mapper.UserMapper' that could not
    be found.</p>
    
    <p>The injection point has the following annotations:
      - @org.springframework.beans.factory.annotation.Autowired(required=true)</p>
    
    <p>Action:</p>
    
    <p>Consider defining a bean of type 'ru.project.mapper.UserMapper' in
    your configuration.</p>
  </blockquote>
  
  <p>Here my source code.</p>
  
  <p>pom.xml</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 http://maven.apache.org/xsd/maven-4.0.0.xsd"&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.1.6.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;ru.project&lt;/groupId&gt;
      &lt;artifactId&gt;project&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;project&lt;/name&gt;
      &lt;description&gt;The project is project of resourse for investors.&lt;/description&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;12&lt;/java.version&gt;
          &lt;org.mapstruct.version&gt;1.3.0.Final&lt;/org.mapstruct.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-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-mail&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
          &lt;/dependency&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-devtools&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
              &lt;optional&gt;true&lt;/optional&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
              &lt;optional&gt;true&lt;/optional&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;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.thymeleaf.extras&lt;/groupId&gt;
              &lt;artifactId&gt;thymeleaf-extras-springsecurity5&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.modelmapper&lt;/groupId&gt;
              &lt;artifactId&gt;modelmapper&lt;/artifactId&gt;
              &lt;version&gt;2.3.5&lt;/version&gt;
          &lt;/dependency&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;/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;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;${java.version}&lt;/source&gt;
                      &lt;target&gt;${java.version}&lt;/target&gt;
                      &lt;annotationProcessorPaths&gt;
                          &lt;path&gt;
                              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
                              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
                          &lt;/path&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;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>My interface UserMapper:</p>
  
  <pre><code>package ru.project.mapper;
  
  import java.util.List;
  
  import org.mapstruct.Mapper;
  import ru.project.domain.User;
  import ru.project.dto.UserForAdmin;
  
  @Mapper
  //@Mapper(componentModel = "spring")
  public interface UserMapper {
  
      UserForAdmin UserToUserForAdmin(User user);
  
      List&lt;UserForAdmin&gt; UserListToUserForAdminList(List&lt;User&gt; user);
  
  
  }
  </code></pre>
  
  <p>My RestController:</p>
  
  <pre><code>package ru.project.controller.rest;
  
  import java.util.List;
  
  import org.mapstruct.factory.Mappers;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  import ru.project.dto.UserForAdmin;
  import ru.project.mapper.UserMapper;
  import ru.project.service.UserService;
  
  @RestController
  public class AdminRestController {
  
      @Autowired
      private UserService userService;
  
      //@Autowired
      //private UserMapper userMapper;
  
      @GetMapping("/admin/users")
      public List&lt;UserForAdmin&gt; findAllUsers(){
  
          UserMapper userMapper = Mappers.getMapper(UserMapper.class);
  
          return userMapper.UserListToUserForAdminList(userService.findAll()); 
      }
  
  }
  
  </code></pre>
  
  <p>I would like to use Awtowired.</p>