Skip to content

Use unpack to support use of schema plugins as artifacts

Jody Garnett edited this page Jul 7, 2020 · 11 revisions
Date May 20 2020 Contacts Jody Garnett
Status In progress Release 3.12
Resources Ticket # #4724
Source code #4701
Funding GeoCat, GeoNetwork Enterprise and professional services

Overview

Build change to package up both the plugin classes (as a jar) and resources (as a zip). To prevent conflict schema-plugin version numbering changed to match core-geonetwork. Build system changed to unpack the zip artifacts, rather than copy content between folders.

Technical Details:

Initially proposed as a simple change to take advantage public OSGeo repository; this change has shown several limitations of the core-geonetwork build system for schema-plugins:

  • Use of schema-plugin version 3.7 across different branches of core-geonetwork, combined with transitive dependencies, ensure conflicts across active branches of core-geonetwork.

  • web app build copies contents folder to folder, rather than make use of schema plugin artifact zip and jar.

  • web app contains competing build configurations (for both war:war and jetty:run) on the management of schema-plugins leading to build instability

The above limitations result in an unstable build environment.

Schema Plugin Changes

Example pom.xml making use of maven-assembly-plugin and core-geonetwork project.version number from parent:

<?xml version="1.0" encoding="UTF-8"?>
<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/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

 <parent>
    <artifactId>schemas</artifactId>
    <groupId>org.geonetwork-opensource.schemas</groupId>
    <version>3.11.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>schema-iso19115-3.2018</artifactId>
  <name>GeoNetwork schema plugin for ISO19115-3:2018 standard</name>

  <dependencies>
    <dependency>
      <groupId>org.geonetwork-opensource.schemas</groupId>
      <artifactId>schema-core</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>

    <resources>
      <resource>
        <directory>src/main/config/translations</directory>
        <targetPath>META-INF/catalog/locales</targetPath>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>

    <plugins>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.5</version>
        <executions>
          <execution>
            <id>test-jar</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>plugin-assembly</id>
            <phase>package</phase>
            <goals><goal>single</goal></goals>
            <inherited>false</inherited>
            <configuration>
             <appendAssemblyId>false</appendAssemblyId>
             <descriptors>
              <descriptor>src/assembly/schema-plugin.xml</descriptor>
             </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>
</project>

Example schema-plugin.xml to package plugins folder:

<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
  <id>plugin</id>
  <includeBaseDirectory>false</includeBaseDirectory>
  <formats>
    <format>zip</format>
  </formats>
  <fileSets>
    <fileSet>
      <directory>src/main/plugin/</directory>
      <outputDirectory></outputDirectory>
      <useDefaultExcludes>true</useDefaultExcludes>
    </fileSet>
  </fileSets>
</assembly>

Proposal Type:

  • Type: Improvement to existing feature
  • Module: schema plugins, metadata101, webapp, root

Voting History

This activity was covered by the Bolsena 2020 code sprint, see Bolsena 2020 Online slides for discussion and decisions.

  • Decision on version numbering:

    • geonetwork: major/minor/revision format
    • “3.10.4-SNAPSHOT”
  • Decision on schema-plugin version:

    • Change: Use geonetwork version above
    • Resolves transitive instability
  • Decision on schema-plugin packaging:

    • publish both jar and zip to osgeo repository
  • Decision on metadata101/iso19115-3.2018

    • Fold into core-geonetwork
    • aside: Can be handled as separate pull request
  • Vote Proposed: TBA

Participants

  • @jodygarentt, @josegar74, @ianwallen, @davidblasby, @@fxprunayre, @Paul

References:

Clone this wiki locally