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 184978 - Change main project for Maven Ent. App to runnable ear and for NBM App to runnable nbm-application
Summary: Change main project for Maven Ent. App to runnable ear and for NBM App to ru...
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P2 normal (vote)
Assignee: David Simonek
URL:
Keywords: USABILITY
Depends on:
Blocks:
 
Reported: 2010-04-26 12:11 UTC by Jaroslav Pospisil
Modified: 2010-06-23 13:08 UTC (History)
4 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 Jaroslav Pospisil 2010-04-26 12:11:47 UTC
Currently when you create Maven Enterprise Application,as main project is set POM project,but it's not runnable and so shortcuts (like F6) don't work for it. This could confuse user,so we should change main project to runnable ear after MEA is created.I speak of no other changes in project structure,just change selected main project.
Comment 1 Antonin Nebuzelsky 2010-04-26 15:19:09 UTC
We need to consider a consistent approach to all Maven multiprojects.

Maven NetBeans Application archetype with the "NetBeans Platform Application" and "NetBeans Platform based Application" projects created is exactly the same case.
Comment 2 David Simonek 2010-04-27 15:14:27 UTC
After studying projectsui code, I came to conclusion that currently it's possible to define only that some of the opened projects should be main, but not which one - there is missing API. (check NewProject around line 200, strange code btw).

New API would be probably something like new property representing rootdir FileObject of the project which should become main.

Or we may live with current situation, as this issue for sure doesn't meet quality criteria for P2 IMHO.

Jesse, what do you think about proposed API change? Thanks.
Comment 3 Jesse Glick 2010-04-27 18:49:06 UTC
(In reply to comment #2)
> After studying projectsui code, I came to conclusion that currently it's
> possible to define only that some of the opened projects should be main, but
> not which one - there is missing API.

I don't think so; you just need to put the one you want to be main first in the list (use a LinkedHashSet).
Comment 4 Petr Jiricka 2010-04-27 21:08:02 UTC
Thanks a lot for looking into this, Dafe. One other aspect of this bug that Tonda and I discussed today is the fact that when you build the container sub-project after it's created ("mavenprojectXYZ-ear JavaEE6 Assembly" or "NetBeans Platform based application"), it does not build because the other subprojects have not been built yet; you have to do "Build with dependencies". So we may want to tie the F11 shortcut + toolbar button to "Build with dependencies" in this case, rather than "Build".

I also agree this bug does not meet the P2 criteria; IMO it's a real P3 bug. I am also adding the USABILITY keyword.
Comment 5 David Simonek 2010-04-28 07:02:02 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > After studying projectsui code, I came to conclusion that currently it's
> > possible to define only that some of the opened projects should be main, but
> > not which one - there is missing API.
> 
> I don't think so; you just need to put the one you want to be main first in the
> list (use a LinkedHashSet).

That's nasty, I don't like dependencies on implementation, but I'll give it a try, thanks.
Comment 6 Antonin Nebuzelsky 2010-04-28 09:51:51 UTC
> So we may want to tie the F11 shortcut + toolbar button
> to "Build with dependencies" in this case, rather than "Build".

We need to resolve this part as well. I found it already filed as an issue #178644.

Jesse, please comment on this as well.
Comment 7 Jesse Glick 2010-04-28 14:34:54 UTC
(In reply to comment #5)
> I don't like dependencies on implementation

It's not a dependency on implementation. Templates.setDefinesMainProject is documented to behave this way.
Comment 8 David Simonek 2010-04-28 14:47:04 UTC
OK then, so it's at least strange :-)
Comment 9 David Simonek 2010-04-28 15:14:44 UTC
Changeset: 04d6d4a4b1b5
Author:    Dafe Simonek <dsimonek@netbeans.org>
Date:      2010-04-28 09:54
Message:   #184978: change main projects to point to ear and nbm-application modules
Issue #184978 - Change main project for Maven Ent. App  to runnable ear
Comment 10 Jaroslav Pospisil 2010-06-23 13:08:36 UTC
v.