Book Image

Apache Maven Cookbook

Book Image

Apache Maven Cookbook

Overview of this book

Table of Contents (18 chapters)
Apache Maven Cookbook
About the Author
About the Reviewers

Using Eclipse to run Maven goals

If you are using Eclipse to develop your project, it is good to know how to run some of the plugins we have discussed earlier using the IDE.

How to do it...

To run Maven goals using Eclipse, use the following steps:

  1. Open the simple project in Eclipse.

  2. Right-click on the project.

  3. Choose Run As.

  4. View the available Maven options:

How it works...

Eclipse provides an option to run various goals from the IDE. Among the ones we have seen in this chapter, clean, compile, and test are offered by Eclipse. There are a few other options as well.

In addition, Eclipse also allows us to modify the configurations as suitable.

Eclipse also allows the project to be Run As a Java Application in the traditional way (without using any Maven plugins). Likewise, it allows a JUnit Test to be run without using Maven.