Mapstruct 没有为我的映射器接口之一生成实现。有没有办法知道原因?

Eya*_*yal 5 mapstruct

我正在使用 mapstruct 从/到域对象映射到 DTO 我有 20 多个正确生成的映射器。

我的一个映射器不再生成,但编译成功。我使用 maven 并showWarningsmaven-compiler-plugin配置中打开了标志,但是我没有看到有关该特定映射器的警告(我确实看到了其他映射器的警告)。

有没有办法从注释处理器中获取一些关于未生成的映射器的信息?

我的映射器界面(名称更改):

@Mapper
public interface PersonMapper {
    PersonMapper INSTANCE = Mappers.getMapper(PersonMapper.class);

    PersonDTO map(Person entity);

    Person map(PersonDTO dto);
}
Run Code Online (Sandbox Code Playgroud)

我的Maven配置:

...
<dependency>
  <groupId>org.mapstruct</groupId>
  <artifactId>mapstruct-jdk8</artifactId>
  <version>1.3.0.Final</version>
</dependency>
...
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5.1</version>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
      <annotationProcessorPaths>
        ...
        <path>
          <groupId>org.mapstruct</groupId>
          <artifactId>mapstruct-processor</artifactId>
          <version>1.3.0.Final</version>
        </path>
      </annotationProcessorPaths>
      <showWarnings>true</showWarnings>
    </configuration>
  </plugin>
Run Code Online (Sandbox Code Playgroud)

Sja*_*aak 0

您可以在即将推出的 MapStruct 版本中进行基本跟踪(详细模式)。查看文档。您可以尝试在项目中使用最新的 MapStruct master 并查看它是否提供有关此功能不起作用的原因的信息。