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.

Bug 242542 - Reload POM does not (always?) work
Summary: Reload POM does not (always?) work
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-04 10:25 UTC by rcasha
Modified: 2015-06-16 02:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rcasha 2014-03-04 10:25:10 UTC
I created a pom-only project with several modules. 

The first thing I noticed is that right-clicking "Modules" and selecting "create new module", the module is created but does not appear under Modules.

After adding modules, I used "Reload POM" to get them to appear under modules, they did not appear. Eventually I closed the project and re-opened it, and they all appeared.
Comment 1 Milos Kleint 2014-03-12 16:02:57 UTC
Was the newly created module actually added to <modules> section of the parent pom?

from inspecting the code there's a few possible explanations.
1. the parent project was not written (unlikely given that project close/IDE restart fixed the problem)
2. the event about project reload didn't reach the node child implementation. Again unlikely, we use a weak listener there but the nodeFactory instance has to be hard referenced for nodes in visible hierarchies I think.
3. for some reason the conversion from basedir + <module> path didn't result in a 
valid FileObject. IMHO a most likely cause but apparently random and I don't see how a project close could fixed it and a project POM reload not. Maybe on close we get a new instance of NodeFactory and that new one was not corrupted.

In any case a reproducible scenario would help here, too many moving parts involved some within and some outside of the maven support codebase.
Comment 2 rcasha 2014-03-12 18:55:03 UTC
Yes it was added to the pom file, it just didn't appear under Modules in the project explorer.
Comment 3 Tomas Stupka 2015-06-15 13:39:05 UTC
> In any case a reproducible scenario would help here, too many moving parts involved some within and some outside of the maven support codebase.
does this problem still occur. I'm unable to reproduce and there are no similar reports since reported (over a year)
Comment 4 Tomas Stupka 2015-06-15 13:44:24 UTC
> does this problem still occur. I'm unable to reproduce and there are no similar reports since reported (over a year)
as if i would be asking for it - it just happened. After closing/reopening the pom module all modules were properly listed.
Comment 5 Tomas Stupka 2015-06-15 16:04:29 UTC
- the created projects folder is queried in PM.findManager during creation, but the pom.xml does not yet physically exits -> the folder is cached as NO_SUCH+PROJECT in ProjectManager
- therefore a subsequent from ModulesNode on PM.findPorject returns null

fixed in jet-main #5a38624ac8e3
Comment 6 Quality Engineering 2015-06-16 02:19:00 UTC
Integrated into 'main-silver', will be available in build *201506160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5a38624ac8e3
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #242542 - Reload POM does not (always?) work