changeset 4113:f72c253663fc

FYLS/AFT/DIPS: Added start script. flys-aft/trunk@5436 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 11 Sep 2012 16:51:19 +0000
parents 23677476fd09
children ae5119da92cd
files flys-aft/ChangeLog flys-aft/README.txt flys-aft/bin/log4j.properties flys-aft/bin/run.sh flys-aft/doc/conf-oracle.xml flys-aft/pom-oracle.xml flys-aft/pom.xml
diffstat 7 files changed, 172 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-aft/ChangeLog	Tue Sep 11 15:36:21 2012 +0000
+++ b/flys-aft/ChangeLog	Tue Sep 11 16:51:19 2012 +0000
@@ -1,4 +1,16 @@
-2012-09-111	Sascha L. Teichmann	<sascha.teichmann@inteavtion.de>
+2012-09-11	Sascha L. Teichmann	<sascha.teichmann@inteavtion.de>
+
+	* README.txt: Added infos how to build.
+
+	* doc/conf-oracle.xml: Demo config for Oracle.
+
+	* bin/run.sh: New start script.
+	* bin/log4j.properties: Demo log4j config.
+
+	* pom.xml: Added config for Maven assembly plugin.
+	* pom-oracle.xml: New. Has extra dependency to Oracle JDBC.
+
+2012-09-11	Sascha L. Teichmann	<sascha.teichmann@inteavtion.de>
 
 	* pom.xml: Java 1.5 -> 1.6
 	* README.txt: Removed new line.
--- a/flys-aft/README.txt	Tue Sep 11 15:36:21 2012 +0000
+++ b/flys-aft/README.txt	Tue Sep 11 16:51:19 2012 +0000
@@ -15,6 +15,32 @@
 
     * Es existiert eine FLYS-Datenbank mit bekannten Credentials.
 
+Bau:
+----
+   * Maven2 sollte installiert und im Pfad liegen.
+     ( http://maven.apache.org/docs/2.2.1/release-notes.html )
+
+     $ mvn --version
+     Sollte Versionsinformationen ausgeben.
+
+   * Für die Nutzung der Oracle JDBC-Bindings muss das Oracle-Treiber-Jar
+     in das lokale Maven-Repository installiert werden:
+
+     $ mvn install:install-file -DgroupId=ojdbc5.jar -DartifactId=ojdbc5 \
+       -Dversion=0 -Dpackaging=jar -Dfile=ojdbc.jar -DgeneratePom=true
+
+   * Für den eigentlichen Oracle-kompatiblen Bau kann dann folgendes
+     aufgerufen werden:
+
+     $ mvn -f pom-oracle.xml clean compile assembly:single
+
+     $ cp target/de.intevation.aft-1.0-SNAPSHOT-jar-with-dependencies.jar \
+       bin/etl.jar
+
+   * Folgendes führt das fertige Programm dann aus:
+
+     $ bin/run.sh
+
 Konfiguration:
 --------------
 
@@ -24,7 +50,7 @@
 System-Property config.file gesetzt werden.
 
 Dies geschieht über den Kommandozeilenparameter "-Dconfig.file=/pfad/zur/config.xml"
-im Start-Skript contrib/run.sh
+im Start-Skript bin/run.sh
 
 Die Konfigurationsdatei hat folgende Struktur:
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-aft/bin/log4j.properties	Tue Sep 11 16:51:19 2012 +0000
@@ -0,0 +1,10 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=DEBUG, A1
+log4j.category.org.hibernate=DEBUG
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%d - %m%n
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-aft/bin/run.sh	Tue Sep 11 16:51:19 2012 +0000
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+bin_dir=`dirname $0`
+bin_dir=`readlink -f $bin_dir`
+exec java \
+    -Dlog4j.configuration=file://$bin_dir/log4j.properties \
+    -Dconfig.file=$bin_dir/../doc/conf-oracle.xml \
+    -jar $bin_dir/etl.jar
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-aft/doc/conf-oracle.xml	Tue Sep 11 16:51:19 2012 +0000
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sync>
+  <!-- The path to the DiPs file -->
+  <dips>
+    <file>/path/to/the/DiPs_FLYS_7_1_7_5.xml</file>
+    <repair>/path/to/the/doc/repair.xsl</repair>
+  </dips>
+  <!-- The FLYS side -->
+  <side name="flys">
+    <db>
+      <driver>oracle.jdbc.OracleDriver</driver>
+      <user>flys</user>
+      <password>flys</password>
+      <url>jdbc:oracle:thin:@//localhost:1521/XE</url>
+    </db>
+  </side>
+  <!-- The AFT side -->
+  <side name="aft">
+    <db>
+      <driver>oracle.jdbc.OracleDriver</driver>
+      <user>aft</user>
+      <password>aft</password>
+      <url>jdbc:oracle:thin:@//localhost:1521/XE</url>
+    </db>
+  </side>
+</sync>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-aft/pom-oracle.xml	Tue Sep 11 16:51:19 2012 +0000
@@ -0,0 +1,75 @@
+<?xml version="1.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>de.intevation</groupId>
+  <artifactId>de.intevation.aft</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>de.intevation.aft</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.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifest>
+              <mainClass>de.intevation.aft.Sync</mainClass>
+              <packageName>de.intevation.aft</packageName>
+            </manifest>
+          </archive>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifest>
+              <mainClass>de.intevation.aft.Sync</mainClass>
+            </manifest>
+          </archive>
+          <descriptorRefs>
+            <descriptorRef>jar-with-dependencies</descriptorRef>
+          </descriptorRefs>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.14</version>
+    </dependency>
+    <dependency>
+      <groupId>org.xerial</groupId>
+      <artifactId>sqlite-jdbc</artifactId>
+      <version>3.7.2</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>postgresql</groupId>
+      <artifactId>postgresql</artifactId>
+      <version>8.4-702.jdbc4</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+       <groupId>ojdbc5.jar</groupId>
+       <artifactId>ojdbc5</artifactId>
+       <version>0</version>
+    </dependency>
+  </dependencies>
+</project>
--- a/flys-aft/pom.xml	Tue Sep 11 15:36:21 2012 +0000
+++ b/flys-aft/pom.xml	Tue Sep 11 16:51:19 2012 +0000
@@ -33,6 +33,19 @@
           </archive>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifest>
+              <mainClass>de.intevation.aft.Sync</mainClass>
+            </manifest>
+          </archive>
+          <descriptorRefs>
+            <descriptorRef>jar-with-dependencies</descriptorRef>
+          </descriptorRefs>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
   <dependencies>

http://dive4elements.wald.intevation.org