Chapter 4. Essential Maven Plugins

In this chapter, we will look at the following recipes:

  • Using the Maven Clean plugin
  • Using the Maven Compiler plugin
  • Changing the compiler used by the Maven Compiler plugin
  • Specifying the Java version for the Compiler plugin
  • Using the Maven Surefire plugin to run unit tests
  • Using the Maven Failsafe plugin to run integration tests
  • Using the Maven Resources plugin
  • Filtering using resources
  • Using Eclipse to run Maven goals
  • Using NetBeans to run Maven goals
  • Using IntelliJ IDEA to run Maven goals

Introduction

In the previous chapter, we learned about the Maven lifecycle and the phases and goals of the lifecycle, understood the essential elements of the pom project configuration file and the settings file, and learned to use Maven profiles and properties.

In this chapter, we will look at how to add and configure plugins to the pom file and use them to perform essential build tasks. Maven has a plugin architecture, and except for core functionalities, every task in Maven is done using plugins. There are a number of plugins that are provided by Maven. In addition, there are several third-party plugins. Maven also provides a mechanism for users to develop their own plugins if they choose to do so.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.218.157