Integrate Maven with Eclipse via External Tool Configuration
During Eclipse development, it’s not practical to go outside of the Eclipse’s environment and execute Maven command in external console.
In this article, we show you how to integrate Maven command with Eclipse IDE, via Eclipse’s “External Tool Configuration“. Normally, this external tool is used to run external command within Eclipse environment, and it works prefectly with Maven command.
1. Configure “External Tool Configuration”
In Eclipse , menu bar, select “Run” –> “External Tool” –> “External Tool Configuration“. Create a new “program”, and link it to your Maven run command (
mvn.bat in Windows), select the working project to run with Maven, and defined your Maven arguments, like “
clean package” , “
install” and etc.
See following figure :
2. Run Maven in Eclipse
To run your new “External Tool Configuration“, select “Run” –> “External Tool” –> “tool name defined by you“. It will execute the Maven command and output the result in the Eclipse console view.
Alternatively, you can install “m2eclipse Eclipse plugin“, which provides complete Maven integration for Eclipse IDE.
But, i do not like the plugin, because, Maven syntax comes with complete XSD support, and “External Tool Configuration” is work pretty well for me, just do not see any obvious benefits of installing this m2eclipse plugin.