How do I build my project?
Author: Deron Eriksson
Description: This tutorial describes how to build a maven project.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1)

Page:    1 2 >

A mavenSW project can be built using the "mvn package" command:

mvn package

As a result, if you're in your project's root directory (that contains your pom.xml file), you can type "mvn package" to build the project. In this tutorial, we'll create an EclipseSW External Tool Configuration to perform the package command on a selected project to build the project via Eclipse.

In other tutorials, we created a default maven project using the "archetype:create" goal and we imported this project into Eclipse. This "mytest" project is shown below.

'mytest' project in Navigator View

The type of package (or "artifact") that is built is specified in a project's pom.xml file by the "packaging" element. The "mytest" project's packaging is specified to be "jar", so a jarW (Java archive) file will be built in response to the "package" goal.


<project xmlns="" xmlns:xsi=""

Here, I create an External Tool Configuration called "mvn package". This will allow us to select a project in the Eclipse Navigator view and then run the External Tool Configuration to perform the maven package command.

External Tool Configuration for 'mvn package'

I selected the "mytest" project and then brought up the "mvn package" external tool. I clicked Run.

Executing 'mvn package' on 'mytest' project via External Tool Configuration

(Continued on page 2)

Page:    1 2 >