Netbeans - run specific Maven integration test

2.2k views Asked by At

How can I configure Netbeans to call Maven Failsafe to run a specific integration test?

I know the Maven command to do this is 'mvn -Dit.test=MyClassIT verify' I also know how to configure 'actions' in Netbeans Project properties.

My problems are:

  • Netbeans sometimes runs the action (and calls Maven), and sometimes just uses its own compiler and test runner. Don't know how to tell it to use which. Bizarre
  • Netbeans adds "Test" to the class name. Instead it should add "IT". But the bizarre part is that there's nothing in the action that defines this behavior. The action just passes the class name.
  • I don't want to override the normal Test File and Debug Test File actions, because I need those for normal tests. But custom actions only appear in the Project's 'Custom' context menu, and not for any individual file! So they're unusuable. It would also be nice if I could make toolbar buttons for them.
  • If the planets align correctly and Netbeans issues the right command, Maven is launched with correct settings, but the debugger doesn't work

Using Netbeans 7.1 and Netbeans Dev 201201260600

1

There are 1 answers

2
lpinto.eu On

If you right click on a project, theres a 'custom' option with as only one child option 'goals'. You can use it to run custom mvn commands; also notice that old commands are kept, so you don't need to type it every time.