commit 2693d2d291febf89e6e1b1a98753e2c9dd982b26
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Thu Nov 3 17:28:33 2016 +0100

    fixing startup, dependency problems of jetty
     - fixed for eclipse ide
     - fixed for maven-jetty plugin

diff --git a/pom.xml b/pom.xml
index 1a0b1f15..3313bb0a 100755
--- a/pom.xml
+++ b/pom.xml
@@ -15,6 +15,8 @@
     <unitils.version>3.4.2</unitils.version>
     <spring.version>4.2.4.RELEASE</spring.version>
     <lucene.version>5.4.1</lucene.version>
+    <maven.compiler.source>1.8</maven.compiler.source>
+    <maven.compiler.target>1.8</maven.compiler.target>
   </properties>
   <prerequisites>
     <maven>3.0.5</maven>
@@ -53,6 +55,7 @@
       </snapshots>
     </repository>
   </repositories>
+  
   <pluginRepositories>
     <pluginRepository>
       <id>vaadin-snapshots</id>
@@ -65,6 +68,19 @@
       </snapshots>
     </pluginRepository>
   </pluginRepositories>
+  
+  <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>com.vaadin</groupId>
+                <artifactId>vaadin-bom</artifactId>
+                <version>${vaadin.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+  
   <distributionManagement>
     <repository>
       <uniqueVersion>false</uniqueVersion>
@@ -107,14 +123,37 @@
     </profile>
   </profiles>
   <build>
+    <resources>
+      <resource>
+        <!-- replace the place holders like ${...} in datasources.xml -->
+        <filtering>true</filtering>
+        <directory>src/test/resources</directory>
+        <targetPath>../test-classes</targetPath>
+        <includes>
+          <include>datasources.xml</include>
+        </includes>
+      </resource>
+      <resource>
+        <!-- all other test resources without filtering -->
+        <directory>src/test/resources</directory>
+        <targetPath>../test-classes</targetPath>
+        <excludes>
+          <exclude>datasources.xml</exclude>
+        </excludes>
+      </resource>
+      <resource>
+        <!-- all main resources without filtering -->
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.3</version>
         <configuration>
-          <source>1.8</source>
-          <target>1.8</target>
+          <source>${maven.compiler.source}</source>
+          <target>${maven.compiler.target}</target>
           <encoding>UTF-8</encoding>
         </configuration>
       </plugin>
@@ -157,10 +196,8 @@
           <!-- <runTarget>mobilemail</runTarget> -->
           <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. 
             This way compatible with Vaadin eclipse plugin. -->
-          <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
-          </webappDirectory>
-          <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
-          </hostedWebapp>
+          <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
+          <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
           <!-- Most Vaadin apps don't need this stuff, guide that to target -->
           <persistentunitcachedir>${project.build.directory}</persistentunitcachedir>
           <deploy>${project.build.directory}/gwt-deploy</deploy>
@@ -204,12 +241,8 @@
             which could not be easily solved.
         -->
         <configuration>
-          <stopKey>stop</stopKey>
-          <stopPort>9199</stopPort>
-          <scanIntervalSeconds>10</scanIntervalSeconds>
           <useTestScope>true</useTestScope>
-          <jettyXml>${basedir}/src/test/resources/etc/jetty/jetty.xml,${basedir}/src/test/resources/etc/jetty/jetty-http.xml</jettyXml>
-          <!-- <jettyXml>./src/test/resources/etc/jetty/jetty.xml,./src/test/resources/etc/jetty/jetty-http.xml,./src/test/resources/etc/jetty/jetty-ssl.xml,./src/test/resources/etc/jetty/jetty-https.xml</jettyXml> -->
+          <scanIntervalSeconds>2</scanIntervalSeconds>
           <systemProperties>
             <force>true</force>
             <systemProperty>
@@ -217,29 +250,32 @@
               <value>h2_cdmTest</value>
             </systemProperty>
             <systemProperty>
-              <!-- The lucene index should be placed into the target folder, 
+              <!-- 
+                The lucene index should be placed into the target folder, 
                 so user.home needs to be set to this folder. user.home needs to be overridden 
-                since it already exists, thus the force option is turned on above -->
+                since it already exists, thus the force option is turned on above 
+              -->
               <name>user.home</name>
               <value>${basedir}/target/</value>
             </systemProperty>
             <systemProperty>
-              <!-- datasources.xml is prepared by <plugins><resources>..</resources> 
-                above -->
+              <!-- 
+                datasources.xml is prepared by <plugins><resources>..</resources> above 
+               -->
               <name>cdm.beanDefinitionFile</name>
               <value>${project.build.directory}/test-classes/datasources.xml</value>
             </systemProperty>
+            <systemProperty>
+                <name>log4j.configuration</name>
+                <value>file:///home/andreas/.cdmLibrary/log4j.properties</value>
+            </systemProperty>            
           </systemProperties>
         </configuration>
         <dependencies>
-            <dependency>
-                <!-- 
-                    Shouldn't this be provided by maven?
-                    Adding it here anyway to solve jetty start up probelms
-                 -->
+          <dependency>
                 <groupId>org.slf4j</groupId>
-                <artifactId>slf4j-api</artifactId>
-                <version>1.7.21</version>
+                <artifactId>slf4j-log4j12</artifactId>
+                <version>1.6.4</version>
             </dependency>
         </dependencies>
       </plugin>
@@ -355,7 +391,7 @@
       <groupId>com.vaadin</groupId>
       <artifactId>vaadin-client</artifactId>
       <version>${vaadin.version}</version>
-      <scope>provided</scope>
+      <scope>test</scope>
     </dependency>
     <!-- disabling push for the moment because it does not work with run-jetty-run 
       due to the fact that the latest (even nightly) version of run-jetty-run uses 
@@ -433,6 +469,12 @@
       <version>${cdmlib.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>eu.etaxonomy</groupId>
+      <artifactId>cdmlib-db</artifactId>
+      <version>${cdmlib.version}</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <!-- adding itextpdf is required to fix dependency problems: itextpdf 
         is an managed transitive dependency of cdmlib-io without adding it here mvn 
@@ -463,25 +505,25 @@
           <artifactId>spring-mock</artifactId>
         </exclusion>
       </exclusions>
-      <scope>provided</scope>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>com.thoughtworks.xstream</groupId>
       <artifactId>xstream</artifactId>
       <version>1.4.7</version>
-      <scope>provided</scope>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-mock</artifactId>
       <version>2.0.8</version>
-      <scope>provided</scope>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context-support</artifactId>
       <version>${spring.version}</version>
-      <scope>provided</scope>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
@@ -509,13 +551,13 @@
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
       <version>1.7.2</version>
-      <scope>provided</scope>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
       <version>1.7.2</version>
-      <scope>provided</scope>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.json</groupId>
diff --git a/src/test/resources/etc/jetty/jetty-http.xml b/src/test/resources/etc/jetty/jetty-http.xml
deleted file mode 100644
index 3707ab2b..00000000
--- a/src/test/resources/etc/jetty/jetty-http.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
-
-<!-- ============================================================= -->
-<!-- Configure the Jetty Server instance with an ID "Server"       -->
-<!-- by adding a HTTP connector.                                   -->
-<!-- This configuration must be used in conjunction with jetty.xml -->
-<!-- ============================================================= -->
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-
-  <!-- =========================================================== -->
-  <!-- Add a HTTP Connector.                                       -->
-  <!-- Configure an o.e.j.server.ServerConnector with a single     -->
-  <!-- HttpConnectionFactory instance using the common httpConfig  -->
-  <!-- instance defined in jetty.xml                               -->
-  <!--                                                             -->
-  <!-- Consult the javadoc of o.e.j.server.ServerConnector and     -->
-  <!-- o.e.j.server.HttpConnectionFactory for all configuration    -->
-  <!-- that may be set here.                                       -->
-  <!-- =========================================================== -->
-  <Call name="addConnector">
-    <Arg>
-      <New class="org.eclipse.jetty.server.ServerConnector">
-        <Arg name="server"><Ref refid="Server" /></Arg>
-        <Arg name="factories">
-          <Array type="org.eclipse.jetty.server.ConnectionFactory">
-            <Item>
-              <New class="org.eclipse.jetty.server.HttpConnectionFactory">
-                <Arg name="config"><Ref refid="httpConfig" /></Arg>
-              </New>
-            </Item>
-          </Array>
-        </Arg>
-        <Set name="host"><Property name="jetty.host" /></Set>
-        <Set name="port"><Property name="jetty.port" default="9180" /></Set>
-        <Set name="idleTimeout"><Property name="http.timeout" default="30000"/></Set>
-      </New>
-    </Arg>
-  </Call>
-
-</Configure>
\ No newline at end of file
diff --git a/src/test/resources/etc/jetty/jetty-https.xml b/src/test/resources/etc/jetty/jetty-https.xml
deleted file mode 100644
index ebcb9ce2..00000000
--- a/src/test/resources/etc/jetty/jetty-https.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
- 
-<!-- ============================================================= -->
-<!-- Configure a HTTPS connector.                                  -->
-<!-- This configuration must be used in conjunction with jetty.xml -->
-<!-- and jetty-ssl.xml.                                            -->
-<!-- ============================================================= -->
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
- 
-  <!-- =========================================================== -->
-  <!-- Add a HTTPS Connector.                                      -->
-  <!-- Configure an o.e.j.server.ServerConnector with connection   -->
-  <!-- factories for TLS (aka SSL) and HTTP to provide HTTPS.      -->
-  <!-- All accepted TLS connections are wired to a HTTP connection.-->
-  <!--                                                             -->
-  <!-- Consult the javadoc of o.e.j.server.ServerConnector,        -->
-  <!-- o.e.j.server.SslConnectionFactory and                       -->
-  <!-- o.e.j.server.HttpConnectionFactory for all configuration    -->
-  <!-- that may be set here.                                       -->
-  <!-- =========================================================== -->
-  <Call id="httpsConnector" name="addConnector">
-    <Arg>
-      <New class="org.eclipse.jetty.server.ServerConnector">
-        <Arg name="server"><Ref refid="Server" /></Arg>
-          <Arg name="factories">
-            <Array type="org.eclipse.jetty.server.ConnectionFactory">
-              <Item>
-                <New class="org.eclipse.jetty.server.SslConnectionFactory">
-                  <Arg name="next">http/1.1</Arg>
-                  <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
-                </New>
-              </Item>
-              <Item>
-                <New class="org.eclipse.jetty.server.HttpConnectionFactory">
-                  <Arg name="config"><Ref refid="sslHttpConfig"/></Arg>
-                </New>
-              </Item>
-            </Array>
-          </Arg>
-          <Set name="host"><Property name="jetty.host" /></Set>
-          <Set name="port"><Property name="https.port" default="9443" /></Set>
-          <Set name="idleTimeout"><Property name="https.timeout" default="30000"/></Set>
-        </New>
-    </Arg>
-  </Call>
-</Configure>
\ No newline at end of file
diff --git a/src/test/resources/etc/jetty/jetty-ssl.xml b/src/test/resources/etc/jetty/jetty-ssl.xml
deleted file mode 100644
index 5473bfa2..00000000
--- a/src/test/resources/etc/jetty/jetty-ssl.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
- 
-<!-- ============================================================= -->
-<!-- Configure a TLS (SSL) Context Factory                         -->
-<!-- This configuration must be used in conjunction with jetty.xml -->
-<!-- and either jetty-https.xml or jetty-spdy.xml (but not both)   -->
-<!-- ============================================================= -->
-<Configure id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
-  <Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.keystore" default="etc/keystore"/></Set>
-  <Set name="KeyStorePassword"><Property name="jetty.keystore.password" default="OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"/></Set>
-  <Set name="KeyManagerPassword"><Property name="jetty.keymanager.password" default="OBF:1u2u1wml1z7s1z7a1wnl1u2g"/></Set>
-  <Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.truststore" default="etc/keystore"/></Set>
-  <Set name="TrustStorePassword"><Property name="jetty.truststore.password" default="OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"/></Set>
-  <Set name="EndpointIdentificationAlgorithm"></Set>
-  <Set name="ExcludeCipherSuites">
-    <Array type="String">
-      <Item>SSL_RSA_WITH_DES_CBC_SHA</Item>
-      <Item>SSL_DHE_RSA_WITH_DES_CBC_SHA</Item>
-      <Item>SSL_DHE_DSS_WITH_DES_CBC_SHA</Item>
-      <Item>SSL_RSA_EXPORT_WITH_RC4_40_MD5</Item>
-      <Item>SSL_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>
-      <Item>SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>
-      <Item>SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</Item>
-    </Array>
-  </Set>
- 
-  <!-- =========================================================== -->
-  <!-- Create a TLS specific HttpConfiguration based on the        -->
-  <!-- common HttpConfiguration defined in jetty.xml               -->
-  <!-- Add a SecureRequestCustomizer to extract certificate and    -->
-  <!-- session information                                         -->
-  <!-- =========================================================== -->
-  <New id="sslHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
-    <Arg><Ref refid="httpConfig"/></Arg>
-    <Call name="addCustomizer">
-      <Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>
-    </Call>
-  </New>
- 
-</Configure>
\ No newline at end of file
diff --git a/src/test/resources/etc/jetty/jetty.xml b/src/test/resources/etc/jetty/jetty.xml
deleted file mode 100644
index 94c4b047..00000000
--- a/src/test/resources/etc/jetty/jetty.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
-
-<!-- ============================================================== -->
-<!-- Sets up characteristics of the org.eclipse.jetty.server.Server -->
-<!-- instance for the plugin to use. Importantly, it sets up the -->
-<!-- org.eclipse.jetty.server.HttpConfiguration element that we can -->
-<!-- refer to in subsequent xml files that configure the connectors -->
-<!-- ============================================================== -->
-
-<Configure id="Server" class="org.eclipse.jetty.server.Server">
-	<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
-		<Set name="secureScheme">http</Set>
-		<Set name="securePort">
-			<Property name="jetty.secure.port" default="9443" />
-		</Set>
-		<Set name="outputBufferSize">32768</Set>
-		<Set name="requestHeaderSize">8192</Set>
-		<Set name="responseHeaderSize">8192</Set>
-		<Set name="sendServerVersion">true</Set>
-		<Set name="sendDateHeader">false</Set>
-		<Set name="headerCacheSize">512</Set>
-		<!-- Uncomment to enable handling of X-Forwarded- style headers <Call name="addCustomizer"> 
-			<Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg> 
-			</Call> -->
-	</New>
-</Configure>
\ No newline at end of file
