gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 17:29:21 24 4
gpt4 key购买 nike

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

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

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

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

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

PersonDTO map(Person entity);

Person map(PersonDTO dto);
}

我的 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>

最佳答案

您可以在即将发布的 MapStruct 版本中进行基本跟踪(详细模式)。查看 documentation .您可以尝试在您的项目中使用最新的 MapStruct master,看看它是否提供了有关为什么这不起作用的信息。

关于Mapstruct 没有为我的映射器接口(interface)之一生成实现。有没有办法知道原因?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57554053/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com