Book Image

Apache Maven Cookbook

Book Image

Apache Maven Cookbook

Overview of this book

Table of Contents (18 chapters)
Apache Maven Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building a pom project


There are many reasons why you may want to make a pom file available as an artifact. One reason is the aggregate project. An aggregate project must have the pom packaging type. Another reason could be a pom, which can be imported as a dependency. Whatever the reason, Maven provides support to build a pom project.

How to do it...

  1. Open a simple pom project (simple-pom-project).

  2. Observe the packaging type:

    <groupId>com.packt.cookbook</groupId>
        <artifactId>simple-pom-project</artifactId>
        <packaging>pom</packaging>
        <version>1.0-SNAPSHOT</version>
        <description>Simple pom project</description>
  3. Build the project:

    mvn clean package
    

    Note that only the clean goal is run.

  4. Run the following command:

        mvn clean install 
    
  5. Observe the output:

How it works...

The following are the default bindings for the pom packaging type:

  • package: site:attach-descriptor: This attaches a descriptor to the site report, if applicable...