Thursday, August 2, 2012

Netbeans and maven: create custom goal

It's very easy to create and store a custom maven goal inside the Netbeans IDE for your projects. Maybe you want to have a goal for clean build but skip test's

  • Just right-click on the module you want to create the goal for and choose Properties
  • Navigate to the Actions tab and press Add custom...
  • Enter a name for your goal - e.g. clean build no tests
  • In Execute goals you can enter the maven-goals you want to execute: clean install
  • adding properties is quite simple: press Add -> and choose the one you need
  • you can also just input the properties you need in the textarea
This custom-action will be stored in the nbactions.xml of the corresponding module:

        
            CUSTOM-clean build no tests
            clean build no tests
            
                clean
                install
            
            
                true