QueryDsl 错误。 Q 类 未生成

QueryDsl error. Q classes not generated

我尝试生成查询类型 类(例如 QUser)但出现错误...

你可以在这里找到我的源代码:https://github.com/TheNakedMan/remindme.server/

我正在使用 IntelliJ IDEA,似乎我有可用的插件。 请帮助我。

日志消息:

/remindme.server/src/main/java/com/qoobico/remindme/server/repository/UserRepository.java Error:(21, 126) java: cannot find symbol symbol: class QUser

Error:(25, 62) java: cannot find symbol symbol: class QUser
location: interface com.qoobico.remindme.server.repository.UserRepository

更新:

在 IntelliJ 中 LifeCycle->clean 和 运行 apt:process 之后,我有这个错误:

[ERROR] Failed to execute goal on project com.qoobico.remindme.server: Could not resolve dependencies for project com.qoobico.remindme.server:com.qoobico.remindme.server:war:1.0-SNAPSHOT: Could not find artifact com.qoobico.remindme.server:com.qoobico.remindme.server:jar:1.0-SNAPSHOT

在您的源代码中,您没有导入生成的 classes,例如:

import com.qoobico.remindme.server.entity.QUser;

如果您想生成 classes 而无需编译 and/or 安装包,请使用 maven goal apt:process

你可以使用IntelliJ来启动这样一个maven目标,使用Maven Projects window。 window 将显示所有可用目标。

在命令行上,您可以使用 mvn cli,可以下载 here。 提示:来自 help plugin mvn help:describe -Dplugin=com.mysema.maven:apt-maven-plugin 的命令将向您显示所有可用的 apt-maven-plugin 目标的列表。

您将输出目录配置为:target/generated-sources/java 要让您的 IDE 找到 classes,请将它们放入您的 class 路径中。像 IntelliJ 这样的一些 IDE 会自动为 maven 项目执行此操作,因为该文件夹是默认文件夹。