Section 2.7. Defining the Default Goal


2.7. Defining the Default Goal

If you are frequently running the weather:run goal from the command line, you may want to specify a default goal for your Maven project. By specifying a default goal, you can run maven from the command line without any arguments, and Maven will execute the weather:run goal.

2.7.1. How do I do that?

To set the default goal for a project, simply list the goal name in the default attribute of the project element:

<?xml version="1.0" encoding="UTF-8"?>    <project xmlns:j="jelly:core" xmlns:ant="jelly:ant"      xmlns:maven="jelly:maven" default="weather:run">        // ...snip...    </project>

When you execute Maven without specifying a goal, Maven will execute the weather:run goal. That was easy enough!



Maven. A Developer's Notebook
Maven: A Developers Notebook (Developers Notebooks)
ISBN: 0596007507
EAN: 2147483647
Year: 2003
Pages: 125

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net