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 240778 - Artifacts not opened after creation of new EAR from Maven with "old" name
Summary: Artifacts not opened after creation of new EAR from Maven with "old" name
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-21 14:58 UTC by Martin Janicek
Modified: 2014-01-29 02:53 UTC (History)
2 users (show)

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 Martin Janicek 2014-01-21 14:58:50 UTC
Copying steps for reproduction from issue 236606 (from which this one was created to separate both problems):

1. Create maven enterprise application with ejb/web/ear
2. Remove all 4 modules with sources removal.
3. Try to create maven enterprise with the same name, got no ejb module opened by default. Also got "unresolved dependency" warning
Comment 1 Martin Janicek 2014-01-21 15:02:50 UTC
CCing original reporter of issue 236606 and targeting for NetBeans 8.0.
Comment 2 Martin Janicek 2014-01-22 09:59:35 UTC
Milosi could you take a look at this?

EAWizardIterator from maven.j2ee calls ArchetypeWizards.createFromArchetype(..) four times (for root project and all of it's sub-projects) and then tries to find them by ArchetypeWizards.openProjects(..)

But when it's done as described in the description (project with the same name was created before and deleted afterwards), the last project is not returned (it almost looks like it wasn't created yet).
Comment 3 Milos Kleint 2014-01-23 08:05:56 UTC
<rant>
sigh .. deletion of projects should be prohibited. Along with rename and copy. I don't recall ever doing it in real work, we're just fixing testcases here.
</rant>


have you actually tried with 8.0? (the original issue is against 7.3) Recently I've done some changes that could be related. Upon deletion, the old project instance was expunged from ProjectManager but in some cases stayed in cache of SimpleFileOwnerQueryImplementation
Comment 4 Martin Janicek 2014-01-23 10:20:35 UTC
I tried it with todays build (enterprise cluster only, but that shouldn't make any difference) and the problem is still there.
Comment 5 Milos Kleint 2014-01-24 08:53:48 UTC
Sorry, I cannot reproduce on my mac. 
From reading the code, the most likely cause for the problem is that the FileObject for the newly generated project is not valid (because of previous deletion?) and therefore ProjectManager.loadProject + isProject return nothing.

reassigning to mjanicek for evaluation, he can reproduce.
Comment 6 Martin Janicek 2014-01-28 10:04:11 UTC
Fixed by change-set: web-main #f8fbb3127fa3

Obviously ArchetypeWizards.createFromArchetype(..) doesn't guarantee that project/folder will be created and available when it finish the work. I wasn't able to see all child folders while iterating the root folder and the last created ejb project folder was missing.

Saving all files did help.
Comment 7 Quality Engineering 2014-01-29 02:53:25 UTC
Integrated into 'main-silver', will be available in build *201401290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f8fbb3127fa3
User: Martin Janicek <mjanicek@netbeans.org>
Log: #240778 - Artifacts not opened after creation of new EAR from Maven with old name