Skip to content

Commit

Permalink
Use -Drelease property to activate profiles for cmis, jcloud, s3 and …
Browse files Browse the repository at this point in the history
…release zip bundles
  • Loading branch information
jodygarnett committed Sep 9, 2023
1 parent 66cf359 commit b0b7b10
Show file tree
Hide file tree
Showing 17 changed files with 539 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
maven-version: 3.6.3
- name: Test with maven
run: |
mvn resources:resources@copy-index-schema-to-source -f web
mvn -B resources:resources@copy-index-schema-to-source -f web
mvn -B -V -fae verify -Pit
- name: Remove SNAPSHOT jars from repository
run: |
Expand Down
141 changes: 95 additions & 46 deletions datastorages/cmis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,53 +79,7 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<excludeScope>provided</excludeScope>
<excludeGroupIds>com.google.code.findbugs</excludeGroupIds>
<excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

<resources>
<resource>
<directory>src/main/resources</directory>
Expand All @@ -151,6 +105,101 @@
</plugins>
</build>
</profile>
<!-- Profile to release datastorage bundle -->
<profile>
<id>release</id>
<activation>
<property>
<!-- include when making a release -->
<name>release</name>
</property>
</activation>
<build>
<plugins>
<!-- stage jars for assembly -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>stage-libs</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<!-- libs to include are managed here rather than in assembly -->
<configuration>
<silent>true</silent>
<includeScope>runtime</includeScope>
<excludeScope>provided</excludeScope>
<excludeGroupIds>com.google.code.findbugs</excludeGroupIds>
<excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<!-- generate html conrtents-->
<plugin>
<groupId>com.ruleoftech</groupId>
<artifactId>markdown-page-generator-plugin</artifactId>
<executions>
<execution>
<id>readme</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>${project.basedir}/src/main/assembly</inputDirectory>
<outputDirectory>${project.build.directory}/html</outputDirectory>
</configuration>
</execution>
<execution>
<id>licenses</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>${project.basedir}/../../</inputDirectory>
<outputDirectory>${project.build.directory}/html/license</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<recursiveInput>false</recursiveInput>
<transformRelativeMarkdownLinks>true</transformRelativeMarkdownLinks>
<headerHtmlFile>${project.basedir}/../../release/src/markdown/html/header.html</headerHtmlFile>
<footerHtmlFile>${project.basedir}/../../release/src/markdown/html/footer.html</footerHtmlFile>
<pegdownExtensions>TABLES,FENCED_CODE_BLOCKS</pegdownExtensions>
<defaultTitle>true</defaultTitle>
</configuration>
</plugin>
<!-- assemble into zip for release -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>release-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<properties>
Expand Down
30 changes: 15 additions & 15 deletions datastorages/cmis/src/main/assembly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

To install the CMIS data storage provider in GeoNetwork:

1. Copy the provided jar files to `{GEONETWORK_DIR}/WEB-INF/lib` folder.
1. Copy the `lib` folder jar files into to `{GEONETWORK_DIR}/WEB-INF/lib` folder.

2. Define the following environmental variables:

- Use CMIS data storage provider:
- Use CMIS data storage provider:

```shell
export GEONETWORK_STORE_TYPE=cmis
```
```bash
export GEONETWORK_STORE_TYPE=cmis
```

- Setup CMIS connection (check with your setup):
- Setup CMIS connection (check with your setup):

```shell
export CMIS_REPOSITORY_ID=-default-
export CMIS_USERNAME=username
export CMIS_PASSWORD=password
export CMIS_SERVICES_BASE_URL=http://localhost:8080/alfresco
export CMIS_BASE_REPOSITORY_PATH=geonetwork
export CMIS_BINDING_TYPE=browser
export CMIS_BROWSER_URL=/api/-default-/public/cmis/versions/1.1/browser
```
```bash
export CMIS_REPOSITORY_ID=-default-
export CMIS_USERNAME=username
export CMIS_PASSWORD=password
export CMIS_SERVICES_BASE_URL=http://localhost:8080/alfresco
export CMIS_BASE_REPOSITORY_PATH=geonetwork
export CMIS_BINDING_TYPE=browser
export CMIS_BROWSER_URL=/api/-default-/public/cmis/versions/1.1/browser
```

3. Start GeoNetwork
10 changes: 5 additions & 5 deletions datastorages/cmis/src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
<fileSets>
<fileSet>
<directory>${project.build.directory}/lib</directory>
<outputDirectory>/</outputDirectory>
<outputDirectory>/lib</outputDirectory>
</fileSet>
</fileSets>

<files>
<file>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<outputDirectory>/</outputDirectory>
<outputDirectory>/lib</outputDirectory>
</file>

<file>
<source>src/main/assembly/README.md</source>
<source>${project.build.directory}/html/README.html</source>
<outputDirectory>/</outputDirectory>
</file>

<file>
<source>${project.basedir}/../../LICENSE.md</source>
<outputDirectory>/</outputDirectory>
<source>${project.build.directory}/html/license/LICENSE.html</source>
<outputDirectory>/license</outputDirectory>
</file>
</files>
</assembly>
141 changes: 95 additions & 46 deletions datastorages/jcloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,53 +106,7 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<excludeScope>provided</excludeScope>
<excludeGroupIds>com.google.code.findbugs</excludeGroupIds>
<excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

<resources>
<resource>
<directory>src/main/resources</directory>
Expand All @@ -178,6 +132,101 @@
</plugins>
</build>
</profile>
<!-- Profile to release datastorage bundle -->
<profile>
<id>release</id>
<activation>
<property>
<!-- include when making a release -->
<name>release</name>
</property>
</activation>
<build>
<plugins>
<!-- stage jars for assembly -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>stage-libs</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<!-- libs to include are managed here rather than in assembly -->
<configuration>
<silent>true</silent>
<includeScope>runtime</includeScope>
<excludeScope>provided</excludeScope>
<excludeGroupIds>com.google.code.findbugs</excludeGroupIds>
<excludeTransitive>false</excludeTransitive>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<!-- generate html conrtents-->
<plugin>
<groupId>com.ruleoftech</groupId>
<artifactId>markdown-page-generator-plugin</artifactId>
<executions>
<execution>
<id>readme</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>${project.basedir}/src/main/assembly</inputDirectory>
<outputDirectory>${project.build.directory}/html</outputDirectory>
</configuration>
</execution>
<execution>
<id>licenses</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>${project.basedir}/../../</inputDirectory>
<outputDirectory>${project.build.directory}/html/license</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<recursiveInput>false</recursiveInput>
<transformRelativeMarkdownLinks>true</transformRelativeMarkdownLinks>
<headerHtmlFile>${project.basedir}/../../release/src/markdown/html/header.html</headerHtmlFile>
<footerHtmlFile>${project.basedir}/../../release/src/markdown/html/footer.html</footerHtmlFile>
<pegdownExtensions>TABLES,FENCED_CODE_BLOCKS</pegdownExtensions>
<defaultTitle>true</defaultTitle>
</configuration>
</plugin>
<!-- assemble into zip for release -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>release-zip</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<properties>
Expand Down
Loading

0 comments on commit b0b7b10

Please sign in to comment.