Skip to content

Maven Notes

illyfrancis edited this page Nov 14, 2013 · 8 revisions

Dependency management

Use <dependencyManagement> to define dependencies and use it by refering to it in <dependencies>.

Plugin management

Similarly, use <pluginManagement> to configure plugins.

Multi module

Refer to Instance Apache Maven Starter.

In sub-module, to refer to parent POM configure it as

<parent>
  <groupId>...</groupId>
  <artifactId>...
  <versionId>...
  <relativePath>../../pom.xml</relativePath>
</parent>

Aparently the default value of <relativePath> is ../pom.xml. The above example assumes the project structure of

some-multi-modules-project
  |- pom.xml (POM aggregator)
  `- some-modules
       |- first-module
       |    `- pom.xml
       |- second-module
       |    `- pom.xml
       `- third-module
            `- pom.xml

Clone this wiki locally