QueryDsl错误。 没有生成Q类
我尝试生成查询类型类(例如QUser
)但是出错…
你可以在这里找到我的源代码: https : //github.com/TheNakedMan/remindme.server/
我正在使用IntelliJ IDEA,似乎我有工作插件。 请帮帮我。
记录消息:
/remindme.server/src/main/java/com/qoobico/remindme/server/repository/UserRepository.java错误:(21,126)java:找不到符号符号:class QUser
错误:(25,62)java:找不到符号符号:class QUser
location:interface com.qoobico.remindme.server.repository.UserRepository
更新:
在LifeCycle->clean
并在IntelliJ中运行apt:process
后,我有这个错误:
[错误]无法在项目com.qoobico.remindme.server上执行目标:无法解析项目com.qoobico.remindme.server的依赖项:com.qoobico.remindme.server:war:1.0-SNAPSHOT:找不到工件com .qoobico.remindme.server:com.qoobico.remindme.server:jar:1.0-SNAPSHOT
在您的源中,您没有导入生成的类,例如:
import com.qoobico.remindme.server.entity.QUser;
如果你想在没有编译的情况下生成类和/或安装包,请使用maven目标 apt:process
。
您可以使用IntelliJ启动这样的maven目标,使用Maven Projects窗口 。 该窗口将显示所有可用目标。
在命令行上你可以使用mvn
cli,可以在这里下载。 提示:来自帮助插件的命令mvn help:describe -Dplugin=com.mysema.maven:apt-maven-plugin
将显示所有可用apt-maven-plugin目标的列表。
您将outputDirectory配置为: target/generated-sources/java
要让IDE找到这些类,请将它们放入类路径中。 某些像IntelliJ这样的IDE会自动为maven项目执行此操作,因为该文件夹是默认文件夹。