Skip to content

Commit

Permalink
troubleshoot release module order of execution and profile acivation …
Browse files Browse the repository at this point in the history
…and handling of jetty folder

Signed-off-by: Jody Garnett <[email protected]>
  • Loading branch information
jodygarnett committed Jan 17, 2024
1 parent 9411ca8 commit 9b05882
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 67 deletions.
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
Expand Down
52 changes: 34 additions & 18 deletions release/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
Release
=======

The release module for GeoNetwork requires jetty to be downloaded before it will package an installer for use.
The release module for GeoNetwork.

1. Build geonetwork if you have not done so already

```
mvn clean install -DskipTests
```
To generate ``zip`` bundles use the release profile (``release``, ``cmis``, ``jcloud``, ``s3``):
```
mvn clean install -Drelease
```

2. From the release folder, download jetty (you only need to do this once):
To generate only for the ``release`` module:
```bash
cd release
mvn clean install -Drelease
```

```
mvn process-resources -Djetty-download
```
This module is designed to be used as part of a full build. It copies files from web/target so gn-web-app must be built first.

3. Once the `jetty` folder is in place the release module will package the `zip` installer:
## Manual release

```
mvn package
```

4. The installer is created in `target` folder.
Open a terminal window and execute the following steps from within the ``release`` folder.

1. Once GeoNetwork has been built (run Maven in the repository root), download Jetty:

3. To clean up the `jetty` folder:
```bash
mvn clean install -Pjetty-download
```

This will download the version of jetty indicated in dependency management, and rename to ``jetty`` folder
(adjusting ``jetty-deploy.xml`` configuration to use `web` rather than default ``webapps``).

2. Next, create the ZIP distributions and copy the WAR:

```
mvn clean:clean@reset
ant
```

The build.xml file will check everything is available and assemble into a zip.

## Jetty download

To clean up the ``jetty`` download, when switching between branches:

```bash
mvn clean:clean@reset
```
2 changes: 1 addition & 1 deletion release/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

<echo message="Creating ZIP file for ${appName} ${version}..."/>

<zip destfile="target/${appName}-${version}/${bundleName}-${version}-${subVersion}.zip">
<zip destfile="target/${appName}-${version}/${bundleName}-${version}-${subVersion}.zip" update="yes">
<zipfileset dir="./bin" excludes="**.sh" prefix="bin" />
<zipfileset dir="./bin" includes="**.sh" prefix="bin" filemode="774"/>
<zipfileset dir="${propsdir}" includes="readme.html, license.html" />
Expand Down
48 changes: 19 additions & 29 deletions release/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<artifactId>release</artifactId>
<packaging>jar</packaging>
<name>Release module</name>
<description>Use to create distribution packages.</description>
<name>GeoNetwork Release module</name>
<description>Use to create zip distribution packages (copies from files from web which must be built first).</description>

<licenses>
<license>
Expand All @@ -23,16 +23,14 @@
</license>
</licenses>

<!-- To force the war build before this module is processed -->
<dependencies>
<dependency>
<groupId>org.geonetwork-opensource</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>web-app</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand All @@ -41,14 +39,10 @@
<execution>
<id>reset</id>
<goals><goal>clean</goal></goals>
<!-- reset working files covered by .gitignore -->
<configuration>
<filesets>
<fileset>
<directory>.</directory>
<includes>
<include>jetty/**</include>
</includes>
<directory>jetty</directory>
</fileset>
</filesets>
</configuration>
Expand All @@ -59,27 +53,25 @@
</build>

<profiles>
<!-- jetty-download is an optional build step for generating release -->
<!-- hack: using the integration phase steps to build before install -->
<profile>
<id>jetty-download</id>
<activation>
<property>
<name>jetty-download</name>
<name>release</name>
</property>
</activation>
<!--activation>
<file>
<missing>jetty</missing>
</file>
</activation-->
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>download-jetty</id>
<phase>generate-resources</phase>
<id>jetty-download</id>
<phase>pre-integration-test</phase>
<!-- prepare-package step moved later in maven lifecycle to avoid slowing down local testing -->
<goals>
<goal>wget</goal>
</goals>
Expand All @@ -92,11 +84,12 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<id>jetty-rename</id>
<phase>pre-integration-test</phase>
<!-- prepare-package step moved later in maven lifecycle to avoid slowing down local testing -->
<goals>
<goal>run</goal>
</goals>
Expand All @@ -119,27 +112,24 @@
<profile>
<id>bundle</id>
<activation>
<file>
<exists>jetty</exists>
</file>
<property>
<name>release</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<phase>post-integration-test</phase>
<!-- package step moved later in maven lifecycle to avoid slowing down local testing -->
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<ant antfile="build.xml" dir="${basedir}" target="distributions">
<property name="build.directory" value="${project.build.directory}"/>
<property name="project.version" value="${project.version}"/>
</ant>
<ant antfile="build.xml"/>
</target>
</configuration>
</execution>
Expand Down
63 changes: 44 additions & 19 deletions web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@
<includes>
<include>META-INF/MANIFEST.MF</include>
<include>data/**</include>
<include>doc/**</include>
<include>doc/en/**</include>
<include>doc/fr/**</include>
<include>images/logos/*</include>
<include>images/logos/statTmp</include>
<include>scripts/lib/**</include>
Expand Down Expand Up @@ -842,24 +843,6 @@
<overwrite>true</overwrite>
</configuration>
</execution>
<execution>
<id>copy-documentation</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<includeEmptyDirs>true</includeEmptyDirs>
<overwrite>true</overwrite>
<outputDirectory>${build.webapp.resources}</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/../docs/manual/target/help</directory>
<targetPath>${basedir}/src/main/webapp/doc</targetPath>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-encryptor-config-to-source</id>
<phase>process-resources</phase>
Expand Down Expand Up @@ -1194,6 +1177,48 @@
</properties>
</profile>

<profile>
<id>with-doc</id>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gn-guide</artifactId>
<version>${project.version}</version>
<classifier>help</classifier>
<type>zip</type>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-documentation</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<includeEmptyDirs>true</includeEmptyDirs>
<overwrite>true</overwrite>
<outputDirectory>${build.webapp.resources}</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/../docs/manual/target/help</directory>
<targetPath>${basedir}/src/main/webapp/doc/en</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>es</id>
<properties>
Expand Down

0 comments on commit 9b05882

Please sign in to comment.