NetBeans IDE为什么看不到生成的源? [英] Why doesn't NetBeans IDE see the generated sources?

查看:170
本文介绍了NetBeans IDE为什么看不到生成的源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Maven内置的Web应用程序,该应用程序在后端使用JPA 2.0。 JPA提供者是EclipseLink 2.3.2。

I have a Maven-built web-app that uses JPA 2.0 at the back end. The JPA provider is EclipseLink 2.3.2.

当我构建项目(并且部署成功运行)时,它将在目录

When I build the project (and it deploys runs successfully) it builds the JPA meta-model in the directory

${basedir}/target/generated-sources/annotations/

但是IDE看不到那里定义的类。到处都有感叹号的小红点。但是我可以在 Projects 窗口中导航到那些文件并打开生成的源文件。

Yet the IDE doesn't see the classes defined there. Little red dots with an exclamation point everywhere. Yet I can navigate to those files in the Projects window and open the generated source files.

这是否发生在其他任何人身上,有人知道吗

Does this happen to anyone else and does anyone know of a way to fix it?

更新:

作为解决方法,我发现我可以退出NetBeans,删除NetBeans缓存目录,然后重新启动。这将迫使NetBeans重建缓存,然后这些类再次可见。我应该向NetBeans错误跟踪器提交错误吗?我无法提出一个测试案例来实现它,但是它确实经常发生。

As a work-around I have discovered that I can exit NetBeans, delete the NetBeans cache directory, then restart. This forces NetBeans to rebuild the cache and then the classes become visible again. Should I submit a bug to the NetBeans bug tracker? I can't come up with a test case to make it happen, but it does fairly often.

推荐答案

项目属性/源中有关于此的注释:您需要在以下源中生成源:

If you go to project properties/sources there is a note about this: you need to generate sources under

${basedir}/target/generated-sources/FOOBAR 

其中 FOOBAR 是名称

这篇关于NetBeans IDE为什么看不到生成的源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆