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 235842

Summary: Maven view for easier execution of lifecyle phases and plugin goals
Product: projects Reporter: markiewb
Component: MavenAssignee: Milos Kleint <mkleint>
Status: RESOLVED FIXED    
Severity: normal CC: markiewb, mjanicek
Priority: P3    
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Screenshot from IDEA
Shows Ant task integration in NB
Shows the plugins in a pom and its counterpart

Description markiewb 2013-09-11 19:25:12 UTC
Created attachment 139952 [details]
Screenshot from IDEA

See screenshot from IDEA.

For a maven project they provide a view which shows 
a) the lifecycle phases and
b) the plugin goals

Each "lifecycle phase"/"plugin goal" has a context menu, which allows
* to Run/Debug
* to set a shortcut 

This could also be combined with the feature of adding a toolbar button for specific goal http://wiki.netbeans.org/wiki/images/a/af/MavenGlobalToolbar.png / https://netbeans.org/bugzilla/show_bug.cgi?id=227283

@Milos: Only as an idea for post 7.4
Comment 1 markiewb 2013-09-29 20:35:01 UTC
Created attachment 140625 [details]
Shows Ant task integration in NB

Screenshot shows the current integration of Ant tasks in NB. The Maven goal integration could also be done like this.
Comment 2 Milos Kleint 2013-09-30 05:25:26 UTC
(In reply to markiewb from comment #1)
> Created attachment 140625 [details]
> Shows Ant task integration in NB
> 
> Screenshot shows the current integration of Ant tasks in NB. The Maven goal
> integration could also be done like this.

lifecycle phases are easy here, how would we decide plugin goal though? the list can be almost indefinite, how to decide what goals reach the premier list?
Comment 3 markiewb 2013-09-30 20:15:49 UTC
Created attachment 140672 [details]
Shows the plugins in a pom and its counterpart

Make it easy. Idea only shows the plugins configured in the current pom.xml so NB could do so. There is no magic. See screenshot.

FYI: When you right click on a goal node, there is a context menu which allows to 
* run/debug the goal
* run/debug the goal with arguments (here you could reuse the dialog from "Project Node|Custom|Goals...")
* set a shortcut for the goal
Comment 4 Milos Kleint 2013-10-01 04:26:42 UTC
(In reply to markiewb from comment #3)
> Created attachment 140672 [details]
> Shows the plugins in a pom and its counterpart
> 
> Make it easy. Idea only shows the plugins configured in the current pom.xml
> so NB could do so. There is no magic. See screenshot.

right, but for many goals it doesn't make sense to be executed on their own. Eg. all that are part of the default lifecycle. in case on nbm:plugin that would be nbm:manifest, nbm:nbm etc. Then you have report plugins that are also special.


> 
> FYI: When you right click on a goal node, there is a context menu which
> allows to 
> * run/debug the goal
> * run/debug the goal with arguments (here you could reuse the dialog from
> "Project Node|Custom|Goals...")
> * set a shortcut for the goal

BTW I've yesterday implemented debugging plugin goals, but it's tied to executing the regular build first (as that's the one collecting the classpath for the debugger). See build output toobar's action for examining the build structure.
Comment 5 markiewb 2013-11-14 16:45:50 UTC
Geertjan blogged about it
https://blogs.oracle.com/geertjan/entry/early_maven_christmas_present_from
Comment 6 markiewb 2013-11-14 16:51:12 UTC
 "Please note that I will still have to work on some serious filtering capabilities, currently just :help goals are skipped by default, but a lot of goals shown cannot be easily executed as they miss parameters, some don't make sense as they are part of default lifecycle etc. Maybe manual filtering by user should be applied as well."


Proposal for "...but a lot of goals shown cannot be easily executed as they miss parameters...": In this case why don't show a dialog where the user can type them in? You may reuse the dialog from "Project Node|Custom|Goals..." (again *g*). IIRC the maven metadata should allow to detect such goals with unset-required parameters (see help:describe)
Comment 7 Milos Kleint 2013-11-18 09:38:38 UTC
considered done.

1. we can filter out help goals
2. we can filter out goals that are somehow associated with the lifecycle (do have execution in the pom bound to a phase)

appears to be sufficient to me.

popup menu contains 2 actions, one executes the goal directly, the other one shows the run goal dialog + prefills all required parameters that are read/write, don't have default value and have an expression property defined. Currently the default action (double click on node) is the just run action. Eventually we could employ some logic to show the dialog in some cases but I don't think it's necessary right now.
Comment 8 markiewb 2013-11-23 18:09:30 UTC
(In reply to Milos Kleint from comment #7)
> considered done.
> 
> 1. we can filter out help goals
> 2. we can filter out goals that are somehow associated with the lifecycle
> (do have execution in the pom bound to a phase)
> 
> appears to be sufficient to me.
> 
> popup menu contains 2 actions, one executes the goal directly, the other one
> shows the run goal dialog + prefills all required parameters that are
> read/write, don't have default value and have an expression property
> defined. Currently the default action (double click on node) is the just run
> action. Eventually we could employ some logic to show the dialog in some
> cases but I don't think it's necessary right now.

I guess it is not integrated yet. I can't see it in dev build 201311210002