gpt4 book ai didi

java - Intellij Error Duplicate Mapper Class with Auto Compile

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

Intellij Ultimate 2020.2 Java & Jhipster 项目,它使用 Map Struct 和 Mapper 类。构建工具是 gradle。根据 here 配置 Intellij (页面底部),但是我找不到将所有构建任务配置为 gradle 的选项。
在我启用 之前,项目一直很好。设置 > 编译器 > 自动构建项目 环境:
enter image description here
然后在运行 gradle build 任务时出现重复的类错误。这是 IDE 提示的重复类。例如:
C:\Users\User\IdeaProjects\Dep\build\generated\sources\annotationProcessor\java\main\test\pot\service\mapper\TaskCodeMapperImpl.java:16:错误:重复类:test.pot.service.mapper。 TaskCodeMapperImpl
公共(public)类 TaskCodeMapperImpl 实现 TaskCodeMapper {
enter image description here
使缓存无效并重新启动并不能解决问题。
更新
enter image description here

最佳答案

时 IDE 将使用它自己的构建器进行自动生成(即使设置了 构建和运行使用:Gradle ),存在一个错误。自动建项目 选项已启用:IDEA-212052 .
作为一种解决方法,请禁用 自动建项目 选项。

关于java - Intellij Error Duplicate Mapper Class with Auto Compile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63279053/

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