Migrating to maven and the new project structure
gvSIG 2.0 has been migrated from ant to maven as a tool for constructing projects. Therefore, the ant build.xml file should be replaced with a maven pom.xml file.
Documentation on the pom.xml file format, as well as general maven documentation, can be found on the maven project website.
There is also a brief introduction and description of how to use maven in the gvSIG 2.0 development guide.
In addition, maven has a default project structure that allows the most common construction operations to be performed with a minimum of configuration. Adapting the project structure for migrating to the default maven structure is therefore quite convenient.
On the other hand, it is more convenient to create a new project from the maven templates or archetypes, and then to migrate the content from the old to the newly created project, rather than trying to convert the old project directory to the maven format.
These maven project templates (archetypes) allow us to create a simple project with everything needed to start working. There are many archetypes available:
If it is an internal project, use the create library or create extension archetype, according to the type of project required.
If the project to be migrated is an extension, then the correspondence between locations in the old and the maven directory is as follows:
- Sources: src -> src/main/java
- Source tests: src-test -> src/test/java
- Multilingual texts: config -> src/main/resources/locale
- config.xml: config -> src/main/resources/config
- Images: images -> src/main/resources/images
- about.htm: config -> src/main/resources/about
- build.number: [RAÍZ] -> src/main/resources
If this is an external project, follow the instructions in the document Creating our project to create the initial project structure.
Note
The external multi-module project archetype must still be created and documented.