Maven by Example

4.1. Introduction

This chapter expands on the information introduced in Chapter 3, A Simple Maven Project. We’re going to create a simple project generated with the Maven Archetype plugin, add some dependencies, add some source code, and customize the project to suit our needs. By the end of this chapter, you will know how to start using Maven to create real projects.

4.1.1. Downloading this Chapter’s Example

We’ll be developing a useful program that interacts with a Yahoo! Weather web service. Although you should be able to follow along with this chapter without the example source code, we recommend that you download a copy of the code to use as a reference. This chapter’s example project may be downloaded with the book’s example code at:

http://www.sonatype.com/books/mvnex-book/mvnex-examples.zip

Unzip this archive in any directory, and then go to the ch-custom/ directory. There you will see a directory named simple-weather/, which contains the Maven project developed in this chapter.