Usually we want to run the MAVEN command in Eclipse, right-click on the project and click Run as, for example:
You can see a lot of existing MAVEN commands, click to run, and see the running information in the console
If the MAVEN command you want to run is not found here, click Maven Build to create a new command, as shown, fill in the Maven command and click Run. The new Maven command can be run again.
========================================================================
However, these operations are very inconvenient, the following to introduce a more convenient way: Click on the Eclipse toolbar Green small icon, I This is the completed state
Click External Tools configurations ..., which appears as shown:
So apply to complete the settings of several common commands, then click Organize Favorites ...
The following window appears, click Add, jump out of the right window, Select all-->ok-->ok; to complete the setup.
Now that you have completed the entire setup process, just select the item and then click the Green button to select the desired command, it is not convenient.
The common MAVEN commands are as follows: (Note that Eclipse has mvn here, so there is no need to fill in mvn)
Compiling source code: MVN Compile
Run Test: MVN test
Packaging: MVN Package
Clear the resulting project: MVN clean
Build Eclipse Project: MVN eclipse:eclipse
Combining goal commands, such as package-only not tested: Mvn-dtest packages
You can even combine commands--mvn clean install to remove and recompile
is not cool crooked. Note To select items First ...
Hope to communicate with the Java learning, you can join the Java Technology Exchange QQ Group: 485731690
Maven-eclipse running the MAVEN command