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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.