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:
.. code-block:: xml
org.gvsig
org.gvsig.core.maven.dependencies
2.0.1-SNAPSHOT
pom
import
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:
.. code-block:: xml
org.gvsig
org.gvsig.core.maven.dependencies
2.0.1-SNAPSHOT
pom
test
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:
.. code-block:: xml
org.gvsig
org.gvsig.tools.lib
jar
compile
org.gvsig
org.gvsig.tools.lib
test-jar
test
org.gvsig
org.gvsig.fmap.geometry
compile
org.gvsig
org.gvsig.fmap.dal
compile
org.gvsig
org.gvsig.metadata.lib.basic.api
compile
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:
.. code-block:: xml
org.gvsig
org.gvsig.fmap.control
compile
org.gvsig
org.gvsig.fmap.dal
compile
org.gvsig
org.gvsig.fmap.geometry
compile
org.gvsig
org.gvsig.fmap.mapcontext
compile