[PATCH] Include both database drivers in one pom.xml

Wald Commits scm-commit at wald.intevation.org
Tue Aug 30 14:40:16 CEST 2022


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1661862800 -7200
#      Tue Aug 30 14:33:20 2022 +0200
# Branch 3.2.x
# Node ID b1b48fa7bd80555c4bdf04fe6bec8f814b9f64bd
# Parent  d1dcb8d28b0d3b69fcfe8bcc0a0f927b108f9f69
Include both database drivers in one pom.xml

This makes it unnecessary to package for a specific database and makes
it possible to connect to both database backends from the same installation
(e.g. in a Docker container).

diff -r d1dcb8d28b0d -r b1b48fa7bd80 artifacts/pom-oracle.xml
--- a/artifacts/pom-oracle.xml	Mon Aug 29 17:10:27 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,206 +0,0 @@
-<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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <groupId>org.dive4elements.river</groupId>
-  <artifactId>river-artifacts</artifactId>
-  <version>1.0-SNAPSHOT</version>
-  <packaging>jar</packaging>
-
-  <name>river-artifacts</name>
-  <url>http://maven.apache.org</url>
-
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
-
-  <build>
-    <plugins>
-      <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-compiler-plugin</artifactId>
-          <version>2.0.2</version>
-          <configuration>
-              <source>1.7</source>
-              <target>1.7</target>
-              <encoding>UTF-8</encoding>
-          </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-javadoc-plugin</artifactId>
-        <version>2.8.1</version>
-        <configuration>
-          <show>private</show>
-          <nohelp>true</nohelp>
-        </configuration>
-      </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <configuration>
-          <descriptors>
-            <descriptor>src/assembly/assembly.xml</descriptor>
-          </descriptors>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-        <version>3.0.0</version>
-        <configuration>
-          <configLocation>../checkstyle.xml</configLocation>
-          <encoding>UTF-8</encoding>
-        </configuration>
-        <executions>
-          <execution>
-            <id>validate</id>
-            <phase>validate</phase>
-            <configuration>
-              <consoleOutput>true</consoleOutput>
-              <failsOnError>true</failsOnError>
-            </configuration>
-            <goals>
-              <goal>check</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>net.sf.ehcache</groupId>
-      <artifactId>ehcache-core</artifactId>
-      <version>2.4.2</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.13</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>trove</groupId>
-      <artifactId>trove</artifactId>
-      <version>1.1-beta-5</version>
-    </dependency>
-    <dependency>
-      <groupId>net.sf.opencsv</groupId>
-      <artifactId>opencsv</artifactId>
-      <version>2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.dive4elements</groupId>
-      <artifactId>artifact-database</artifactId>
-      <version>1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.dive4elements</groupId>
-      <artifactId>artifacts-common</artifactId>
-      <version>1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.dive4elements.river</groupId>
-      <artifactId>river-backend</artifactId>
-      <version>1.0-SNAPSHOT-ora</version>
-    </dependency>
-    <dependency>
-      <groupId>org.jfree</groupId>
-      <artifactId>jfreechart</artifactId>
-      <version>1.0.15</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.xmlgraphics</groupId>
-      <artifactId>batik-dom</artifactId>
-      <version>1.7</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.xmlgraphics</groupId>
-      <artifactId>batik-svggen</artifactId>
-      <version>1.7</version>
-    </dependency>
-    <dependency>
-      <groupId>com.lowagie</groupId>
-      <artifactId>itext</artifactId>
-      <version>2.1.7</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-math</artifactId>
-      <version>2.2</version>
-    </dependency>
-    <dependency>
-      <groupId>com.h2database</groupId>
-      <artifactId>h2</artifactId>
-      <version>1.3.158</version>
-    </dependency>
-    <dependency>
-        <groupId>commons-io</groupId>
-        <artifactId>commons-io</artifactId>
-        <version>2.4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.geotools</groupId>
-      <artifactId>gt-shapefile</artifactId>
-      <version>2.7.2</version>
-    </dependency>
-    <dependency>
-      <groupId>org.geotools</groupId>
-      <artifactId>gt-epsg-wkt</artifactId>
-      <version>2.7.2</version>
-    </dependency>
-    <dependency>
-      <groupId>org.geotools</groupId>
-      <artifactId>gt-geojson</artifactId>
-      <version>2.7.2</version>
-    </dependency>
-    <dependency>
-      <groupId>org.geotools</groupId>
-      <artifactId>gt-swing</artifactId>
-      <version>2.7.2</version>
-    </dependency>
-    <dependency>
-      <groupId>org.hibernatespatial</groupId>
-      <artifactId>hibernate-spatial</artifactId>
-      <version>1.1.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.json</groupId>
-      <artifactId>json</artifactId>
-      <version>20090211</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.velocity</groupId>
-      <artifactId>velocity</artifactId>
-      <version>1.7</version>
-    </dependency>
-    <dependency>
-      <groupId>net.sf.jasperreports</groupId>
-      <artifactId>jasperreports</artifactId>
-      <version>4.5.0</version>
-      <exclusions>
-        <exclusion>
-          <groupId>jfree</groupId>
-          <artifactId>jfreechart</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.groovy</groupId>
-      <artifactId>groovy-all</artifactId>
-      <version>1.6.0</version>
-    </dependency>
-  </dependencies>
-  <repositories>
-    <repository>
-      <id>gt2.repo</id>
-      <name>GeoTools2 Repository including JTS</name>
-      <url>https://repo.osgeo.org/repository/release</url>
-    </repository>
-    <repository>
-      <id>Hibernate Spatial repo</id>
-      <url>http://www.hibernatespatial.org/repository</url>
-    </repository>
-  </repositories>
-</project>
diff -r d1dcb8d28b0d -r b1b48fa7bd80 backend/pom-oracle.xml
--- a/backend/pom-oracle.xml	Mon Aug 29 17:10:27 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-<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">
-  <modelVersion>4.0.0</modelVersion>
-
-  <groupId>org.dive4elements.river</groupId>
-  <artifactId>river-backend</artifactId>
-  <version>1.0-SNAPSHOT-ora</version>
-  <packaging>jar</packaging>
-
-  <name>river-backend</name>
-  <url>http://maven.apache.org</url>
-
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.0.2</version>
-        <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
-          <encoding>UTF-8</encoding>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <version>2.10</version>
-        <executions>
-          <execution>
-            <id>analyze</id>
-            <goals>
-              <goal>analyze-only</goal>
-            </goals>
-            <configuration>
-              <failOnWarning>true</failOnWarning>
-              <ignoreNonCompile>true</ignoreNonCompile>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <version>2.4</version>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>org.dive4elements.river.importer.Importer</mainClass>
-              <packageName>org.dive4elements.river.importer</packageName>
-            </manifest>
-          </archive>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <version>2.3</version>
-        <configuration>
-          <transformers>
-            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
-              <mainClass>org.dive4elements.river.importer.Importer</mainClass>
-            </transformer>
-          </transformers>
-        </configuration>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <configuration>
-          <descriptors>
-            <descriptor>src/assembly/assembly.xml</descriptor>
-          </descriptors>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-checkstyle-plugin</artifactId>
-        <version>3.0.0</version>
-        <configuration>
-          <configLocation>../checkstyle.xml</configLocation>
-          <encoding>UTF-8</encoding>
-        </configuration>
-        <executions>
-          <execution>
-            <id>validate</id>
-            <phase>validate</phase>
-            <configuration>
-              <consoleOutput>true</consoleOutput>
-              <failsOnError>true</failsOnError>
-            </configuration>
-            <goals>
-              <goal>check</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.dive4elements</groupId>
-      <artifactId>artifacts-common</artifactId>
-      <version>1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <!-- Add less unsave version of transitive hibernate dependency -->
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-      <version>3.2.2</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.hibernate</groupId>
-      <artifactId>hibernate-core</artifactId>
-      <version>3.6.10.Final</version>
-      <exclusions>
-        <!-- exclude unsafe transitive dependency -->
-        <exclusion>
-          <groupId>commons-collections</groupId>
-          <artifactId>commons-collections</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>org.hibernate.javax.persistence</groupId>
-      <artifactId>hibernate-jpa-2.0-api</artifactId>
-      <version>1.0.1.Final</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-api</artifactId>
-      <version>2.17.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-core</artifactId>
-      <version>2.17.1</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-dbcp2</artifactId>
-      <version>2.1.1</version>
-    </dependency>
-    <dependency>
-      <groupId>com.vividsolutions</groupId>
-      <artifactId>jts</artifactId>
-      <version>1.11</version>
-    </dependency>
-    <dependency>
-      <groupId>org.hibernatespatial</groupId>
-      <artifactId>hibernate-spatial-oracle</artifactId>
-      <version>1.1.1</version>
-      <scope>runtime</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.oracle.database.jdbc</groupId>
-      <artifactId>ojdbc8</artifactId>
-      <version>[19,20)</version>
-      <scope>runtime</scope>
-    </dependency>
-  </dependencies>
-
-  <repositories>
-    <repository>
-        <id>Hibernate Spatial repo</id>
-        <url>http://www.hibernatespatial.org/repository</url>
-    </repository>
-  </repositories>
-</project>
diff -r d1dcb8d28b0d -r b1b48fa7bd80 backend/pom.xml
--- a/backend/pom.xml	Mon Aug 29 17:10:27 2022 +0200
+++ b/backend/pom.xml	Tue Aug 30 14:33:20 2022 +0200
@@ -160,6 +160,8 @@
       <artifactId>jts</artifactId>
       <version>1.11</version>
     </dependency>
+
+    <!-- database drivers -->
     <dependency>
       <!-- overwrite dependency of postgis-jdbc -->
       <groupId>org.postgresql</groupId>
@@ -185,6 +187,18 @@
       <version>1.1.1</version>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>com.oracle.database.jdbc</groupId>
+      <artifactId>ojdbc8</artifactId>
+      <version>[19,20)</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernatespatial</groupId>
+      <artifactId>hibernate-spatial-oracle</artifactId>
+      <version>1.1.1</version>
+      <scope>runtime</scope>
+    </dependency>
   </dependencies>
 
   <repositories>
diff -r d1dcb8d28b0d -r b1b48fa7bd80 contrib/make_flys_release/bin/make-importer-package.sh
--- a/contrib/make_flys_release/bin/make-importer-package.sh	Mon Aug 29 17:10:27 2022 +0200
+++ b/contrib/make_flys_release/bin/make-importer-package.sh	Tue Aug 30 14:33:20 2022 +0200
@@ -25,14 +25,13 @@
 
 OPTIONS:
    -?, --help          Show this message
-   -o, --oracle        Package is for Oracle.
    VERSION must specify a tag (usually MAYOR.MINOR.PATCH) or a branch name.
    With EXTRAS, a tarball with dependencies can be given.
 EOF
 exit 0
 }
 
-OPTS=`getopt -o ?,o -l help,oracle -n $0 -- "$@"`
+OPTS=`getopt -o ? -l help -n $0 -- "$@"`
 
 if [ $? != 0 ] ; then usage; fi
 eval set -- "$OPTS"
@@ -43,9 +42,6 @@
     "--")
       shift
       break;;
-    "-o"|"--oracle")
-      BUILD_ORACLE="TRUE"
-      shift;;
     *)
       echo "Unknown Option $1"
       usage;;
@@ -81,11 +77,7 @@
 pdflatex importer-manual.tex
 
 # package importer
-if [ "$BUILD_ORACLE" = "TRUE" ]; then
-    mvn -f $SOURCE_DIR/backend/pom-oracle.xml clean package assembly:single
-else
-    mvn -f $SOURCE_DIR/backend/pom.xml clean package assembly:single
-fi
+mvn -f $SOURCE_DIR/backend/pom.xml clean package assembly:single
 
 echo "INFO: create tarball"
 rm -fr $PKG_DIR
diff -r d1dcb8d28b0d -r b1b48fa7bd80 contrib/make_flys_release/make_release.sh
--- a/contrib/make_flys_release/make_release.sh	Mon Aug 29 17:10:27 2022 +0200
+++ b/contrib/make_flys_release/make_release.sh	Tue Aug 30 14:33:20 2022 +0200
@@ -37,7 +37,6 @@
    -t                  Tag the selected branch with given name.
                        Note that \$USER is used as the repository user name
                        for pushing the tags.
-   -o, --oracle        Release is for oracle.
    TARGET must specify a tag (usually MAYOR.MINOR.PATCH) or a branch name.
 EOF
 exit 0
@@ -56,8 +55,8 @@
 # customizable variables
 ELBE_MODEL_UUID=${ELBE_MODEL_UUID:-1a4825f6-925f-11e3-8165-001f29e71d12}
 
-OPTS=`getopt -o ?w:,?t:,o \
-     -l help,oracle \
+OPTS=`getopt -o ?w:,?t: \
+     -l help \
      -n $0 -- "$@"`
 
 if [ $? != 0 ] ; then usage; fi
@@ -72,9 +71,6 @@
     "-w")
       WORK_DIR=$2
       shift 2;;
-    "-o"|"--oracle")
-      BUILD_ORACLE="TRUE"
-      shift;;
     "-t")
       DO_TAG=$2
       shift 2;;
@@ -273,14 +269,7 @@
 echo "INFO: compile and build sources"
 cp $WORK_DIR/wsplgen-linux-64bit-static \
     $FLYS_SOURCE_DIR/river/artifacts/bin/wsplgen
-
-if [ "$BUILD_ORACLE" = "TRUE" ]; then
-    mvn -f $FLYS_SOURCE_DIR/river/backend/pom-oracle.xml clean compile install
-    mvn -f $FLYS_SOURCE_DIR/river/artifacts/pom-oracle.xml \
-        package assembly:single
-else
-    mvn -f $FLYS_SOURCE_DIR/river/artifacts/pom.xml package assembly:single
-fi
+mvn -f $FLYS_SOURCE_DIR/river/artifacts/pom.xml package assembly:single
 mvn -f $FLYS_SOURCE_DIR/river/gwt-client/pom.xml clean compile package
 
 


More information about the Dive4Elements-commits mailing list