[英]QueryDsl error. Q classes not generated
I try to generate query type classes (eg QUser
) but got errors... 我尝试生成查询类型类(例如
QUser
)但是出错...
You can find my source code here: https://github.com/TheNakedMan/remindme.server/ 你可以在这里找到我的源代码: https : //github.com/TheNakedMan/remindme.server/
I'am working with IntelliJ IDEA, and it seems like I have working plugin. 我正在使用IntelliJ IDEA,似乎我有工作插件。 Help me, please.
请帮帮我。
Log message: 日志消息:
/remindme.server/src/main/java/com/qoobico/remindme/server/repository/UserRepository.java Error:(21, 126) java: cannot find symbol symbol: class QUser
/remindme.server/src/main/java/com/qoobico/remindme/server/repository/UserRepository.java错误:(21,126)java:找不到符号符号:class QUser
Error:(25, 62) java: cannot find symbol symbol: class QUser
错误:(25,62)java:找不到符号符号:class QUser
location: interface com.qoobico.remindme.server.repository.UserRepositorylocation:interface com.qoobico.remindme.server.repository.UserRepository
UPDATE: 更新:
After LifeCycle->clean
and run apt:process
in IntelliJ, I have this error: 在
LifeCycle->clean
并在IntelliJ中运行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
[错误]无法在项目com.qoobico.remindme.server上执行目标:无法解析项目com.qoobico.remindme.server的依赖项:com.qoobico.remindme.server:war:1.0-SNAPSHOT:找不到工件com .qoobico.remindme.server:com.qoobico.remindme.server:罐:1.0-SNAPSHOT
In your sources you did not import the generated classes, for instance: 在您的源中,您没有导入生成的类,例如:
import com.qoobico.remindme.server.entity.QUser;
If you want to generate the classes without compile and/or install the package use the maven goal apt:process
. 如果你想在没有编译的情况下生成类和/或安装包,请使用maven目标
apt:process
。
You can use IntelliJ to start such a maven goal, use the Maven Projects window . 您可以使用IntelliJ启动这样的maven目标,使用Maven Projects窗口 。 The window will show you all available goals.
该窗口将显示所有可用目标。
On the commandline you could use the mvn
cli, which can be downloaded here . 在命令行上你可以使用
mvn
cli,可以在这里下载。 Hint: the command from the help plugin mvn help:describe -Dplugin=com.mysema.maven:apt-maven-plugin
will show you a list of all available apt-maven-plugin goals. 提示:来自帮助插件的命令
mvn help:describe -Dplugin=com.mysema.maven:apt-maven-plugin
将显示所有可用apt-maven-plugin目标的列表。
You configured the outputDirectory to: target/generated-sources/java
To let your IDE find that classes, put them into your class path. 您将outputDirectory配置为:
target/generated-sources/java
要让IDE找到这些类,请将它们放入类路径中。 Some IDEs like IntelliJ will do this automatically for maven projects, because that folder is the default. 某些像IntelliJ这样的IDE会自动为maven项目执行此操作,因为该文件夹是默认文件夹。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.