wiki:Maven

Version 15 (modified by Fxp, 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 2 packages:

  • WAR files (intermap.war, geonetwork.war, geoserver.war)
  • Binary ZIP package (with Jetty)

Assembly plugin is used to create the packages using:

mvn assembly:assembly

Assembly configuration is in release package (See bin.xml and zip-war.xml).

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

Voting History

Backwards Compatibility Issues

See open issues.

Risks

Participants

  • Francois
  • Mathieu
  • Maven experts very welcomed !

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.