New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetBeans does not show packages or classes for secondary source directories in build/ #132

Closed
shevek opened this Issue Apr 10, 2014 · 11 comments

Comments

Projects
None yet
4 participants
@shevek

shevek commented Apr 10, 2014

I have lots of generated sources in build/generated-sources/[...]. Netbeans cannot show the packages or sources in these build/* directories, although they do work in the src/* directories.

Examples of plugins which generate these build/generated-sources directories include gradle-velocity-plugin, gradle-sablecc-plugin, gradle-jaxb-plugin, and so forth.

This may be related to #130 but I've raised it separately, as it's quite a distinct bug: The sources aren't shared, and they are within the project root.

@kelemen

This comment has been minimized.

Owner

kelemen commented Apr 10, 2014

Currently, source roots are only displayed if their directory exist when being listed. I plan to fix this sometime in the future (automatically hide and display nodes as they are created or removed) but until then, you can select "Source roots/Create source roots" in the project's context menu,

@shevek

This comment has been minimized.

shevek commented Apr 10, 2014

I did a full refresh of the project node after running the task that generated the build/* source directories. I also tried 'refresh project node' and 'refresh folder' on the visible source roots. The source group(s) are displayed, and there is a . but the real packages within those are not present.

If I find-usages on a symbol which is referenced in one of the invisible files, netbeans finds it, and can open it from the usages view, but ctrl-shift-1 to "find in projects" does says "The document node could not be found in the projects tab."

missing-package-nodes

@kelemen

This comment has been minimized.

Owner

kelemen commented Apr 10, 2014

If the file is within the source folder and the package node itself is displayed, then I'm almost certain that it is a bug in NetBeans because that node is created by a single NB call in JavaExtensionNodes.

@shevek

This comment has been minimized.

shevek commented Apr 10, 2014

If I use a netbeans-ant project, and add these dirs to project.xml as extra source dirs, it works (mostly) fine.

Restarting netbeans cold does not cause a refresh.

@kelemen

This comment has been minimized.

Owner

kelemen commented Apr 11, 2014

Does you path contain a symbolic link?

@shevek

This comment has been minimized.

shevek commented Apr 12, 2014

No. It's entirely simple. inherit-main-java is created by a Sync task right before compileJava, so the filesystem looks as trivial as possible to netbeans - I'm copying the sources around rather than linking to a single copy.

But once it's created, it's a simple, regular directory with files in it, just like any other.

@kelemen

This comment has been minimized.

Owner

kelemen commented Apr 12, 2014

This issue is rather strange, can you provide a very simple example project which I can use to reproduce the issue?

@shevek

This comment has been minimized.

shevek commented Apr 14, 2014

I will try. Leave it with me, please, and thank you for your attention.

@akarnokd

This comment has been minimized.

akarnokd commented Apr 29, 2014

I have a similar issue within RxJava under NetBeans IDE 8.0 (Build 201403101706). The rxjava-core works but when I open any of the sub projects such as rx-java-contrib/rxjava-string, all the source files are marked with error and opening them shows it can't find the classes from rxjava-core. Running the clean & build on the root however succeeds.

@timroes

This comment has been minimized.

timroes commented Aug 15, 2014

I can confirm the very same behavior. I generate sources to build/generated-sources and the corresponding node in the project explorer stays empty as in above screenshot.

If I change the path where the files are generated to src/generated-sources it will be able to show the files, so this must somehow be linked to placing the files in build/.

@kelemen

This comment has been minimized.

Owner

kelemen commented Mar 4, 2015

This should be fixed in master (reopen if anyone still experiences this issue).

@kelemen kelemen closed this Mar 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment