IntelliJ:无法在子项目中找到 JAXB 生成的类
我有一个 Maven 项目,其中有许多子项目。由于历史原因,该项目的结构如下:
Root
- client
- core
- model
- parent
- webapp
其中parent 是根项目的父pom。
这可以从命令行构建良好,但是在 IntelliJ 中我尝试单独运行我的单元测试。
在客户端中,我有一个单元测试,运行时,Make 命令给我 86 条消息(“错误:package-info.class(没有这样的文件或目录)”),其中无法找到创建的任何 JAXB类。
我的其他同事没有遇到这个问题,但我们的设置似乎是相同的(显然不是)。我尝试过 IntelliJ 10.5.4 和 11.0.1,都给出了同样的问题。
它在 Linux (Ubuntu 11.10) 上运行。
另外:
我可以从根项目运行 Maven 安装,但是,如果我右键单击测试类并选择“运行 blahblahblahtest”,我会收到此消息。当我去检查我已选择的配置时(我想要它,因为我希望它更新),但在 make 期间我收到了消息。
xjc 目标目录 (${project.build.directory}/ generated-sources/jaxb) 设置为源目录。仅在 intellij 内的 make 周期期间才会失败。
I have a Maven project which has a number of child projects. For historical reasons the project is structured like this:
Root
- client
- core
- model
- parent
- webapp
where parent is the parent pom for the root project.
This builds fine from the command line, however in IntelliJ I am trying to run my unit tests separately.
In client, I have a unit test, which when run, the Make command is giving me 86 messages ("Error: package-info.class (No such file or directory)") where it is unable to find any of the JAXB created classes.
My other colleagues are not having this problem, but our setup appears to be the same (obviously not). I have tried 10.5.4 and 11.0.1 of IntelliJ, both give the same problem.
This is running on a Linux (Ubuntu 11.10).
Additional:
I can run a maven install from the root project fine, however, if I right click on the test class and select "Run blahblahblahtest" I get this message. When I go to examine the configuration I have make selected (which I want, as I want it to update), but during the make I am getting the messages.
The xjc target directory (${project.build.directory}/generated-sources/jaxb) is set as a source directory. It is only during the make cycle within intellij that it is failing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您已将 xjc 目标目录添加到源代码目录列表中以进行测试。
Make sure you have you added the xjc target directory to the list of your source code directories for testing.