[PATCH 2 of 2] ETL: use Java 7, include run-script and docs when packaging

Wald Commits scm-commit at wald.intevation.org
Wed May 17 16:12:58 CEST 2017


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1495030264 -7200
# Node ID d8d71005a210df98160a0041fb31b1958c754e35
# Parent  c9a22d62593add4405d7c636bf45a2d47bdf75b2
ETL: use Java 7, include run-script and docs when packaging.

Changes to bin/run.sh might have been avoidable, but
at least its more in line with artifacts now.

diff -r c9a22d62593a -r d8d71005a210 etl/README.txt
--- a/etl/README.txt	Wed May 17 15:53:32 2017 +0200
+++ b/etl/README.txt	Wed May 17 16:11:04 2017 +0200
@@ -31,14 +31,16 @@
    * Für den eigentlichen Oracle-kompatiblen Bau kann dann folgendes
      aufgerufen werden:
 
-     $ mvn -f pom-oracle.xml clean compile assembly:single
+     $ mvn -f pom-oracle.xml clean package assembly:single
 
-     $ cp target/river-etl-1.0-SNAPSHOT-jar-with-dependencies.jar \
-       bin/etl.jar
+     Das Archiv target/river-etl-1.0-SNAPSHOT-bin.tar.gz kann dann an den Ort
+     der Installation verschoben und schließlich entpackt werden:
+
+     $ tar xzf river-etl-1.0-SNAPSHOT-bin.tar.gz
 
    * Folgendes führt das fertige Programm dann aus:
 
-     $ bin/run.sh
+     $ river-etl-1.0-SNAPSHOT/bin/run.sh
 
 Konfiguration:
 --------------
diff -r c9a22d62593a -r d8d71005a210 etl/bin/run.sh
--- a/etl/bin/run.sh	Wed May 17 15:53:32 2017 +0200
+++ b/etl/bin/run.sh	Wed May 17 16:11:04 2017 +0200
@@ -1,8 +1,18 @@
 #!/bin/bash
 
-bin_dir=`dirname $0`
-bin_dir=`readlink -f $bin_dir`
+APP=org.dive4elements.river.etl.aft.Sync
+
+DIR=`dirname $0`
+DIR=`readlink -f $DIR`
+
+CLASSPATH=
+for l in `find "$DIR/lib" -name \*.jar -print`; do
+   CLASSPATH=$CLASSPATH:$l
+done
+
+export CLASSPATH
+
 exec java \
-    -Dlog4j.configuration=file://$bin_dir/log4j.properties \
-    -Dconfig.file=$bin_dir/../doc/conf-oracle.xml \
-    -jar $bin_dir/etl.jar
+    -Dlog4j.configuration=file://$DIR/log4j.properties \
+    -Dconfig.file=$DIR/../doc/conf.xml \
+    $APP
diff -r c9a22d62593a -r d8d71005a210 etl/pom-oracle.xml
--- a/etl/pom-oracle.xml	Wed May 17 15:53:32 2017 +0200
+++ b/etl/pom-oracle.xml	Wed May 17 16:11:04 2017 +0200
@@ -17,33 +17,17 @@
         <artifactId>maven-compiler-plugin</artifactId>
         <version>2.0.2</version>
         <configuration>
-          <source>1.6</source>
-          <target>1.6</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>org.dive4elements.river.etl.aft.Sync</mainClass>
-              <packageName>org.dive4elements.river.etl.aft</packageName>
-            </manifest>
-          </archive>
+          <source>1.7</source>
+          <target>1.7</target>
         </configuration>
       </plugin>
       <plugin>
         <artifactId>maven-assembly-plugin</artifactId>
+        <version>3.0.0</version>
         <configuration>
-          <archive>
-            <manifest>
-              <mainClass>org.dive4elements.river.etl.aft.Sync</mainClass>
-            </manifest>
-          </archive>
-          <descriptorRefs>
-            <descriptorRef>jar-with-dependencies</descriptorRef>
-          </descriptorRefs>
+          <descriptors>
+            <descriptor>src/assembly/assembly.xml</descriptor>
+          </descriptors>
         </configuration>
       </plugin>
     </plugins>
diff -r c9a22d62593a -r d8d71005a210 etl/pom.xml
--- a/etl/pom.xml	Wed May 17 15:53:32 2017 +0200
+++ b/etl/pom.xml	Wed May 17 16:11:04 2017 +0200
@@ -17,33 +17,17 @@
         <artifactId>maven-compiler-plugin</artifactId>
         <version>2.0.2</version>
         <configuration>
-          <source>1.6</source>
-          <target>1.6</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <manifest>
-              <mainClass>org.dive4elements.river.etl.aft.Sync</mainClass>
-              <packageName>org.dive4elements.river.etl.aft</packageName>
-            </manifest>
-          </archive>
+          <source>1.7</source>
+          <target>1.7</target>
         </configuration>
       </plugin>
       <plugin>
         <artifactId>maven-assembly-plugin</artifactId>
+        <version>3.0.0</version>
         <configuration>
-          <archive>
-            <manifest>
-              <mainClass>org.dive4elements.river.aft.Sync</mainClass>
-            </manifest>
-          </archive>
-          <descriptorRefs>
-            <descriptorRef>jar-with-dependencies</descriptorRef>
-          </descriptorRefs>
+          <descriptors>
+            <descriptor>src/assembly/assembly.xml</descriptor>
+          </descriptors>
         </configuration>
       </plugin>
     </plugins>


More information about the Dive4Elements-commits mailing list