CHAPTER 5

image

Maven Life Cycle

Goals and Plug-ins

Build processes generating artifacts typically require several steps and tasks to be completed successfully. Examples of such tasks include compiling source code, running a unit test, and packaging of artifacts. Maven uses the concept of goals to represent such granular tasks.

To better understand what a goal is, let’s look at an example. Listing 5-1 shows the compile goal executed on gswm project code under C:\apress\gswm-book\chapter5\gswm. As the name suggests, the compile goal compiles source code. The compile goal identifies the Java class HelloWorld.java under src/main/java, compiles it, and ...

Get Introducing Maven now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.