Monday, October 03, 2011

Recipe#8: Setting Up Parent Maven Project In Eclipse

Whenever you create Maven projects, a best practice is to start with a parent project from which child modules will inherit. The parent POM defines global settings and doesn't itself produce a deliverable. Child modules would include the deliverables, project documentation (user guides and API docs), libraries (if this is a dependency for other projects), etc. It eases maintenance and extensibility tremendously.

This recipe assumes you have Java (see recipe#2), Maven2 (see recipe#6),  and Eclipse (see recipe#3) configured.

In Eclipse:
* File > New > Other. Select Maven | Maven Project [Next]. Use default workspace location [Next]. Select "maven-archetype-quickstart" [Next]. Provide archetype parameters [Finish].
* Update the POM, providing #properties, #description, #licenses, #organization and #developers information, and plugin information for the compiler and surefire (test) plugins. Notice that #packaging ought to be pom.

<?xml version="1.0" encoding="UTF-8"?>
<project ...>
        An online personal financial management application.
              <name>The Apache Software License, Version 2.0</name>
        <name>Strive Consulting, LLC</name>

            <name>Jubz Madagascar</name>
            <organization>Strive Consulting, LLC</organization>

No comments: