It is not possible to run a batch script package directly in IDEA, or perform a sequence of actions before running in IDEA 11.
In IDEA 12, you can specify several actions to perform before starting, so you can create a Maven target that will restart Tomcat (by running the batch version of the script or some other way) and in the Before Launch
list, specify 2 actions: kill the running Tomcat process (which may be another Maven target, a different launch configuration or Ant task) and run the build (Maven target). Here's what this interface looks like in IDEA 12:
![Before launch](https://fooobar.com/undefined)
When you run this configuration, it will kill Tomcat, build and reboot Tomcat.
It should also work if you associate multiple launch configurations with the Run Another Configuration
Before Launch step.
IDEA 12 is scheduled for late 2012, but the first versions of EAP will be available in a few weeks.
Another solution would be to use the same Maven goal with the Mojo Executor or Ant task, which will complete all 3 actions.
source share