changeset 8835:d8d71005a210

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.
author Tom Gottfried <tom@intevation.de>
date Wed, 17 May 2017 16:11:04 +0200
parents c9a22d62593a
children f06d7a40bde5
files etl/README.txt etl/bin/run.sh etl/pom-oracle.xml etl/pom.xml
diffstat 4 files changed, 33 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- 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:
 --------------
--- 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
--- 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>
--- 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>

http://dive4elements.wald.intevation.org