Dependencies between projects
First, let's see what dependencies the assistant has left us with in the org.gvsig.viewer project. Notice the following entry in the dependencyManagement section in the project's pom.xml file:
<dependencies>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.core.maven.dependencies</artifactId>
<version>2.0.1-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
This imports the dependencies of the various gvSIG libraries so that we don't have to worry about the versions of any of the gvSIG base libraries. As this importing is done in the dependencyManagement section, it is for information purposes only, ie a dependency on these libraries is not set.
If we now look at the dependencies section, we find the entry:
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.core.maven.dependencies</artifactId>
<version>2.0.1-SNAPSHOT</version>
<type>pom</type>
<scope>test</scope>
</dependency>
This sets the implementation and test dependencies for all the core libraries of gvSIG so that we won't have to worry about whether all the implementations of the gvSIG APIs are loaded when testing our projects.
In addition we see:
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.tools.lib</artifactId>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.tools.lib</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.fmap.geometry</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.fmap.dal</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
<scope>compile</scope>
</dependency>
These are fixed build dependencies with the main gvSIG libraries, and are usually required in almost any project that we make with gvSIG.
This configuration of dependencies is found in the main project. Let's now see what dependencies are required for the subprojects.
org.gvsig.viewer.lib/pom.xml. This does not provide any declarations of dependencies additional to those defining the parent project already discussed.
org.gvsig.viewer.lib.api/pom.xml. Neither of these provide new dependencies.
org.gvsig.viewer.lib.impl/pom.xml. Does not provide new dependencies, but in this project we should add dependencies to the API project, both for compilation and for execution of tests.
org.gvsig.viewer.swing/pom.xml. Although not providing new dependencies, defined as dependencies of the lib.api. projects.
org.gvsig.viewer.swing.api/pom.xml. Does not add new dependencies.
org.gvsig.viewer.swing.imple/pom.xml. Although not providing dependencies you must declare dependencies with the swing API for testing and building.
Warning
There is also has a dependency on the implementation for compilation and even if you don't think you need it, you should review it.
And finally org.gvsig.viewer.main/pom.xml. This will declare the dependencies with our libraries' API for compilation and implementation for execution. Also adds build dependencies to the gvSIG libraries it uses, these being:
<dependency> <groupId>org.gvsig</groupId> <artifactId>org.gvsig.fmap.control</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.gvsig</groupId> <artifactId>org.gvsig.fmap.dal</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.gvsig</groupId> <artifactId>org.gvsig.fmap.geometry</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.gvsig</groupId> <artifactId>org.gvsig.fmap.mapcontext</artifactId> <scope>compile</scope> </dependency>