Buttons to run Maven targets in NetBeans

余生颓废 提交于 2019-12-05 13:18:02

问题


I'd like to have a button to run (custom) Maven targets in NetBeans 6.9. Hot-keys would also be nice. Is this possible?

If it is not possible: is there something like a console where I could Maven commands directly?


回答1:


In NetBeans 6.9: Right-click on the project -> Custom -> Goals. Make sure to check "Remember as: ". You can run this by Right-click on the project -> Custom -> "myRememberAsName"

I don't know if there is an easy way to assign this to a button or a short cut.




回答2:


Instead of using custom goals you can create a custom profile.

In the project properties, go in pane Configurations, add a new one, select it then click on Activate.

In the pane Run select your custom configuration.

Then in pane Actions select your custom configuration and add/edit the goals you need.

The goals that are already present can't be removed but you can delete the content in "Execute goals" and they will do nothing.

Then when you will click on Run button the goals you have set will be execute.

PS : There is a console in Netbeans (Window->Output->Terminal) but in 6.9 it's still experimental (and pretty inattractive), the one in 7.1.1 works well.




回答3:


My solution isn't exactly what you are looking for, but it is worth mentioning. First, run your custom target in Netbeans. Once you do that, in the "Run" menu you see the "Repeat xxx" at the bottom. This menu has a keyboard shortcut (Command F11 on Mac, not sure what it is on other operating systems). Thus, using this keyboard shortcut, you can run the same maven goal repeatedly.



来源:https://stackoverflow.com/questions/3413270/buttons-to-run-maven-targets-in-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!