Complete documentation for the project.xml file for maven can be found at the maven site, and in particular in the project descriptor part of the reference section. So, we only show the things specific to a GeoTools2 module project.xml file here.
Extending a parent module
|
Maven 1 The <extend> tag allows one project.xml file to inherit items from another. Modules should extend the project.xml within the top level GeoTools2 directory. Also, the path given to the other project.xml file must begin with ${basedir} in order for maven to find it. Example: <extend>${basedir}/../../project.xml<extend> |
Maven 2 The <parent> section allows one pom.xml file to inherit items from another. Modules should extend the pom.xml within the module, plugin, ext} or {{demo directory they belong to. <parent> <groupId>org.geotools</groupId> <artifactId>gt2-module</artifactId> <version>2.2-SNAPSHOT</version> </parent> |
Id
|
Maven 1 The id should reflect the name of the module. However, because the main project.xml defined groupId to be gt2, there is no need to prepend a GeoTools prefix. Examples are main and referencing. |
Maven 2 The id should reflect the name of the module. Because the groupId is defined to be org.geotools (as required by the new Maven policy) and do not appears in the final JAR filenames, a gt2 prefix shall be prepended. Examples are gt2-main and gt2-referencing. |
Dependency
Dependencies are specified within the project.xml (Maven 1) or pom.xml (Maven 2) file, but care should be taken.
New dependencies, and in particular any dependency on another GeoTools2 module, should use:
| groupId | identify the project |
| artifactId | identify the jar within that project |
artifactIds correspond to modules in GeoTools2.
Sample project.xml or pom.xml dependency entry:
|
Maven 1 <dependency> <groupId>gt2</groupId> <artifactId>main</artifactId> <version>2.2.x</version> </dependency> |
Maven 2 <dependency> <groupId>org.geotools</groupId> <artifactId>gt2-main</artifactId> <version>2.2-SNAPSHOT</version> </dependency> |
| Dependencies issue with Maven 1 Dependencies are not transitive in Maven 1. In other words, suppose module B has a dependency on module A. If you are creating module C, and have a dependency on module B, then you do not automatically have a dependency on module A. If C depends on A, then you must add the dependency manually. This issue do not exists anymore with Maven 2. |