Version 14 (modified by 15 years ago) ( diff ) | ,
---|
Maven
Date | 2010/03/25 |
Contact(s) | Mathieu, Francois |
Last edited | Timestamp |
Status | Draft |
Assigned to release | |
Resources | |
Ticket |
Overview
At the Bolsena hacking event 2009, we decided to move from ant build to maven.
Maven structure
First changes was to identify main modules and clean dependencies to not to have cyclic references between them. To fix cyclic references, minor refactoring was made (trying to not to change too much the current code base).
Before
After
GeoNetwork is divided in the following modules :
GeoNetwork sandbox :
svn co https://geonetwork.svn.sourceforge.net/svnroot/geonetwork/sandbox/maven geonetwork-mvn
Major changes
- CSW client : removed
- Jetty : removed and start the web application using Maven related plugins (see Run the application)
- Installer :
- for the time being we start with assembly plugin is used to create a ZIP package with licence and war files
- TODO : use izpack maven plugin to create the installer.
- TODO : use maven release strategy (SNAPSHOT, version) and maven phase to deploy new release
- OAI-PMH dependencies
- Duplicate iso date class to fix cyclic reference (FIXME?).
- Test : removed
- integration test and unit test should be clearly define and separate using maven lifecycle phases (integration-test, ...)
- removed to fix cyclic reference with GAST.
- refactor integration test ion ordre to use jetty maven plugin instead of using local maven. require a Jetty embedded which has been removed (test was starting Jeeves, to run test).
- GAST :
- GAST was using only the application path to load both resources and libs (from WEB-INF/lib). Added a libPath and an appPath.
- Remove jetty and mckoi startup and init (see Open issues)
- Current status : GAST could be used to create db (not mckoi ones) and load data once the catalogue is started.
Maven build
Build the application
mvn clean install -- Skip test mvn clean install -Dmaven.test.skip=true -- Offline use mvn clean install -o
Packaging the application
GeoNetwork is distributed as WAR files (intermap.war and geonetwork.war) packaged by maven process. Assembly plugin is used to create a ZIP file with 2 required WAR files.
mvn assembly:assembly
Assembly configuration is in release package.
Run the application
Maven plugins for Jetty or Cargo allows to quickly start the application after build.
War files
Publish war files created by maven to your favorite webapp directory (Tomcat, Jetty).
Maven plugin / Cargo
Cargo looks to be the best option to run the application (easily start more than one webapp).
See : http://cargo.codehaus.org/
mvn cargo:start mvn cargo:stop
Maven plugin / Jetty
mvn jetty:run
Current issue with jetty plugin is that we cannot run more than one application at a time (only geonetwork.war is started, not intermap.war).
Deploy the application
Deploy mechanism has been setup and tested with an scp connection to a remote server. We need to define where to create GeoNetwork repositories.
maven deploy
Create an eclipse workspace
mvn eclipse:eclipse
Open issues
- GAST :
- FIXME / hardcoded classpath in MANIFEST
- What to do with GAST and embedded jetty and mckoi ?
Proposal Type
- Type: Architecture
- App: GeoNetwork
- Module: All
Links
- Email discussions:
- IRC discussions:
Voting History
Backwards Compatibility Issues
See open issues.
Risks
Participants
- Francois
- Mathieu
- Maven experts very welcomed !
Attachments (3)
- maven.png (34.9 KB ) - added by 15 years ago.
- maven-after.png (4.9 KB ) - added by 15 years ago.
- maven-before.png (5.6 KB ) - added by 15 years ago.
Download all attachments as: .zip