This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | SourcesHelper should mark external roots even if they are not yet built | ||
---|---|---|---|
Product: | projects | Reporter: | entonio <entonio> |
Component: | Ant Project | Assignee: | Tomas Stupka <tstupka> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | CC: | musilt2 |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Example projects to reproduce the problem. |
Description
entonio
2008-02-22 13:52:38 UTC
The E, F and G are wrongly set up, missing dependency on C, but I don't know if it's a case of this bug. I should correct myself: 1 - E, F & G do not need C to compile - they just need it to run, but they only 'run' inside G 2 - G depends on all of them, not only A and F - it only needs A/F to compile, but needs all of them to run because of point 1. Created attachment 57098 [details]
Example projects to reproduce the problem.
I have found a problem that is quite likely the root cause for the problems described here. Steps to reproduce: 1. download the attached package, unpack. 2. do *not* build the projects 3. start an IDE, open the projects - the reference to a.A in b.Main is marked as unresolvable 4. build the projects - the reference becomes resolvable, but an attempt to rename it fails (~"the project is not open") 5. restart the IDE - the everything works OK now. 6. clean the projects and restart the IDE - everything is back to 3 again. The root cause of this problem is that the projects have dist folder defined outside there project dir, and the build artifacts do not exist at the time the IDE starts up. The SourcesHelper does not mark non-existing external roots as being owned by the given project (uses FileObjects instead of URIs). The Java infrastructure asks the SourceForBinaryQuery (which delegates to ProjectSourceForBinaryQuery) to find sources for the project output jar. FileOwnerQuery is used to find owning Project, but it is (obviously) not found. This in turn results into inability to resolve the reference to a.A. Please note that the SFBQ itself works over URLs, and can therefore handle non-existing files/folders. I think that there are at least two places where this needs to be fixed: -SourcesHelper must use URI to register the external roots instead of FileObjects -although there is FileOwnerQuery.getOwner(URI), I do not think it can work for a URI that denotes a file that is itself non-existent, and whose parents are either non-existent, or not owned by the same project as the file itself. A workaround is to keep the projects built (especially during IDE startup). *** Issue 85348 has been marked as a duplicate of this issue. *** This issue is not new, it works this way since new ant based projects were introduced. This issue can only be reproduced if user modifies property 'dist.dir' in project.properties file by hand and also if those projects in question are not built during IDE startup. Workaround can be either have those projects built before starting IDE or don't let clean target to delete the ${dist.dir} folder, but only its content. It could be done by adding following snippet into build.xml of the project: <target name="-post-clean"> <mkdir dir="${dist.dir}"/> </target> Due to these facts I'm lowering priority to standard P3. Setting TM to future, because fix will require changes in very core parts of projects infrastructure, which will not be done for 6.1 release. Changes to external root registration logic are too risky for 6.9. still reproducible. This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss |