Working with the Lutece core

Project layout

The Maven project for the Lutece core is quite similar to a regular WAR project (note that, for historical reasons, Lutece projects do not use the directory structure suggested by Maven 2. Webapp components are stored in webapp , and other sources in src ):

lutece-core
 +- src
 |  +- java
 |  +- site
 |  +- sql
 |  +- conf
 |     +- default
 +- webapp

The only specificities lie in the POM :

  • the project packaging is set to lutece-core :

    <project>
            ...
            <groupId>fr.paris.lutece</groupId>
            <artifactId>lutece-core</artifactId>
            <packaging>lutece-core</packaging>
            <version>2.0.0</version>
  • maven-lutece-plugin is also declared in the build/plugins section (this is required for all Lutece projects):

    <project>
            ...
            <build>
                    ...
                    <plugins>
                            <plugin>
                                    <groupId>fr.paris.lutece</groupId>
                                    <artifactId>maven-lutece-plugin</artifactId>
                                    <extensions>true</extensions>
                            </plugin>

You also probably noticed the src/conf/default directory. Lutece projects have a specific way of handling configuration files, which is described here .

Development and testing

Like the WAR plugin, the Lutece plugin provides an in-place deployment goal:

mvn lutece:inplace

This will invoke the lutece:inplace mojo, which assembles the webapp directly in the webapp source directory. You can configure a Tomcat context on this directory, to allow fast redeployment and testing.

Packaging

Packaging is invoked with the following command:

mvn package

Note : in Maven 2 terminology, packaging refers to the construction of Maven artifacts, in other words the binary components that will be stored in the Maven repository and reused by other Maven projects. This command does not generate a Lutece WAR.

The package phase is bound to the lutece:package mojo, which will generate two artifacts:

  • a JAR containing the core's classes ;

  • a ZIP containing the webapp components.

Generate Lutece core distribution

mvn lutece:assembly

This goal will generate two artifacts :

  • a ZIP containing core's sources

  • a ZIP containing :

    • a WAR file, made with core webapp, ready to be deployed and could be a base to embed Lutece plugins, which should be activate in the administration control panel.

    • database initialisation files

    Note : Case of webapp wich will embed many lugins, it's advised to carry out a Lutèce site.