wiki:Maven

Version 19 (modified by mcoudert, 14 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
      • a binary package with jetty and the webapps embedded.
    • TODO : use izpack maven plugin to create the installer (ticket #240).
    • 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 : moved into separate directory for now
    • integration test and unit test should be clearly define and separate using maven lifecycle phases (integration-test, ...)
    • refactor integration test in 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 :
    • FIXME: GAST is using only the application path to load both resources and libs (from WEB-INF/lib). We should add a libPath and an appPath.
    • Remove jetty and mckoi startup and init (see Open issues)

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 clean package 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

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 eclipse projects

mvn eclipse:eclipse

Debug jetty:run in Eclispe

See : http://docs.codehaus.org/display/JETTY/Debugging+with+the+Maven+Jetty+Plugin+inside+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

  • Vote proposed June 07th 2010
  • Votes:
    • Simon Pigot +1
    • François Prunayre +1
    • Jeroen Ticheler +1

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.