Mar 8, 2018 2:32:42 PM seb leridon avatar   1386

Create a Lutèce site POM.xml

Introduction

The POM file for a site contains at least the following information:

  • The declaration of the parent POM lutece-site-pom in latest version for all sites
  • Maven repository statements ("Snapshot" optional)
  • The declaration of the plugins that make up the site as dependencies

Dependency Management

Several tools are available for the development of POM sites:

  • AppStore: Provides POMs of standard sites incorporating the latest versions of each of the plugins.
  • List of Components: Provides a list of all components (plugins, modules, libraries) with the latest Release and Snapshot versions as well as quick access to current changes and anomalies.
  • Upgrade Dependencies: Provides the list of dependencies in their latest version in XML format of the POM for a given list of plugins.

Example of POM

Here is an example of a POM:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/maven-v4_0_0.xsd">

    <parent>
        <artifactId>lutece-site-pom</artifactId>
        <groupId>fr.paris.lutece.tools</groupId>
        <version>2.0.4</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>fr.paris.lutece</groupId>
    <artifactId>site-mysite</artifactId>
    <packaging>lutece-site</packaging>
    <name>Site My Site</name>
    <version>1.0.0-SNAPSHOT</version>

    <repositories>
        <repository>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>luteceSnapshot</id>
            <name>luteceSnapshot</name>
            <url>http://dev.lutece.paris.fr/snapshot_repository</url>
        </repository>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>lutece</id>
            <name>luteceRepository</name>
            <url>http://dev.lutece.paris.fr/maven_repository</url>
        </repository>
    </repositories>

    <dependencies>

        <!-- Lutece Core -->
        <dependency>
            <groupId>fr.paris.lutece</groupId>
            <artifactId>lutece-core</artifactId>
            <version>5.0.1</version>
            <type>lutece-core</type>
        </dependency>

        <!-- Specific plugins -->
        <dependency>
            <groupId>fr.paris.lutece.plugins</groupId>
            <artifactId>plugin-myplugin</artifactId>
            <version>1.2.1</version>
            <type>lutece-plugin</type>
        </dependency>
        ...

        <!-- Generic plugins -->
        <dependency>
            <groupId>fr.paris.lutece.plugins</groupId>
            <artifactId>plugin-contact</artifactId>
            <version>4.0.0</version>
            <type>lutece-plugin</type>
        </dependency>
        ...
        <dependency>
            <groupId>fr.paris.lutece.plugins</groupId>
            <artifactId>plugin-systeminfo</artifactId>
            <version>3.1.0</version>
            <type>lutece-plugin</type>
        </dependency>

    </dependencies>
</project>

IMPORTANT For a recipe or production site, do not use version ranges for dependencies. Explicit versions must be used. It is advisable to remove the "Snapshot" repository declaration to ensure that all versions of the components are in perfect control.