O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required