Project

General

Profile

« Previous | Next » 

Revision 2693d2d2

Added by Andreas Kohlbecker over 5 years ago

fixing startup, dependency problems of jetty

  • fixed for eclipse ide
  • fixed for maven-jetty plugin

View differences:

pom.xml
15 15
    <unitils.version>3.4.2</unitils.version>
16 16
    <spring.version>4.2.4.RELEASE</spring.version>
17 17
    <lucene.version>5.4.1</lucene.version>
18
    <maven.compiler.source>1.8</maven.compiler.source>
19
    <maven.compiler.target>1.8</maven.compiler.target>
18 20
  </properties>
19 21
  <prerequisites>
20 22
    <maven>3.0.5</maven>
......
53 55
      </snapshots>
54 56
    </repository>
55 57
  </repositories>
58
  
56 59
  <pluginRepositories>
57 60
    <pluginRepository>
58 61
      <id>vaadin-snapshots</id>
......
65 68
      </snapshots>
66 69
    </pluginRepository>
67 70
  </pluginRepositories>
71
  
72
  <dependencyManagement>
73
        <dependencies>
74
            <dependency>
75
                <groupId>com.vaadin</groupId>
76
                <artifactId>vaadin-bom</artifactId>
77
                <version>${vaadin.version}</version>
78
                <type>pom</type>
79
                <scope>import</scope>
80
            </dependency>
81
        </dependencies>
82
    </dependencyManagement>
83
  
68 84
  <distributionManagement>
69 85
    <repository>
70 86
      <uniqueVersion>false</uniqueVersion>
......
107 123
    </profile>
108 124
  </profiles>
109 125
  <build>
126
    <resources>
127
      <resource>
128
        <!-- replace the place holders like ${...} in datasources.xml -->
129
        <filtering>true</filtering>
130
        <directory>src/test/resources</directory>
131
        <targetPath>../test-classes</targetPath>
132
        <includes>
133
          <include>datasources.xml</include>
134
        </includes>
135
      </resource>
136
      <resource>
137
        <!-- all other test resources without filtering -->
138
        <directory>src/test/resources</directory>
139
        <targetPath>../test-classes</targetPath>
140
        <excludes>
141
          <exclude>datasources.xml</exclude>
142
        </excludes>
143
      </resource>
144
      <resource>
145
        <!-- all main resources without filtering -->
146
        <directory>src/main/resources</directory>
147
      </resource>
148
    </resources>
110 149
    <plugins>
111 150
      <plugin>
112 151
        <groupId>org.apache.maven.plugins</groupId>
113 152
        <artifactId>maven-compiler-plugin</artifactId>
114 153
        <version>3.3</version>
115 154
        <configuration>
116
          <source>1.8</source>
117
          <target>1.8</target>
155
          <source>${maven.compiler.source}</source>
156
          <target>${maven.compiler.target}</target>
118 157
          <encoding>UTF-8</encoding>
119 158
        </configuration>
120 159
      </plugin>
......
157 196
          <!-- <runTarget>mobilemail</runTarget> -->
158 197
          <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. 
159 198
            This way compatible with Vaadin eclipse plugin. -->
160
          <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
161
          </webappDirectory>
162
          <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
163
          </hostedWebapp>
199
          <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
200
          <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
164 201
          <!-- Most Vaadin apps don't need this stuff, guide that to target -->
165 202
          <persistentunitcachedir>${project.build.directory}</persistentunitcachedir>
166 203
          <deploy>${project.build.directory}/gwt-deploy</deploy>
......
204 241
            which could not be easily solved.
205 242
        -->
206 243
        <configuration>
207
          <stopKey>stop</stopKey>
208
          <stopPort>9199</stopPort>
209
          <scanIntervalSeconds>10</scanIntervalSeconds>
210 244
          <useTestScope>true</useTestScope>
211
          <jettyXml>${basedir}/src/test/resources/etc/jetty/jetty.xml,${basedir}/src/test/resources/etc/jetty/jetty-http.xml</jettyXml>
212
          <!-- <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> -->
245
          <scanIntervalSeconds>2</scanIntervalSeconds>
213 246
          <systemProperties>
214 247
            <force>true</force>
215 248
            <systemProperty>
......
217 250
              <value>h2_cdmTest</value>
218 251
            </systemProperty>
219 252
            <systemProperty>
220
              <!-- The lucene index should be placed into the target folder, 
253
              <!-- 
254
                The lucene index should be placed into the target folder, 
221 255
                so user.home needs to be set to this folder. user.home needs to be overridden 
222
                since it already exists, thus the force option is turned on above -->
256
                since it already exists, thus the force option is turned on above 
257
              -->
223 258
              <name>user.home</name>
224 259
              <value>${basedir}/target/</value>
225 260
            </systemProperty>
226 261
            <systemProperty>
227
              <!-- datasources.xml is prepared by <plugins><resources>..</resources> 
228
                above -->
262
              <!-- 
263
                datasources.xml is prepared by <plugins><resources>..</resources> above 
264
               -->
229 265
              <name>cdm.beanDefinitionFile</name>
230 266
              <value>${project.build.directory}/test-classes/datasources.xml</value>
231 267
            </systemProperty>
268
            <systemProperty>
269
                <name>log4j.configuration</name>
270
                <value>file:///home/andreas/.cdmLibrary/log4j.properties</value>
271
            </systemProperty>            
232 272
          </systemProperties>
233 273
        </configuration>
234 274
        <dependencies>
235
            <dependency>
236
                <!-- 
237
                    Shouldn't this be provided by maven?
238
                    Adding it here anyway to solve jetty start up probelms
239
                 -->
275
          <dependency>
240 276
                <groupId>org.slf4j</groupId>
241
                <artifactId>slf4j-api</artifactId>
242
                <version>1.7.21</version>
277
                <artifactId>slf4j-log4j12</artifactId>
278
                <version>1.6.4</version>
243 279
            </dependency>
244 280
        </dependencies>
245 281
      </plugin>
......
355 391
      <groupId>com.vaadin</groupId>
356 392
      <artifactId>vaadin-client</artifactId>
357 393
      <version>${vaadin.version}</version>
358
      <scope>provided</scope>
394
      <scope>test</scope>
359 395
    </dependency>
360 396
    <!-- disabling push for the moment because it does not work with run-jetty-run 
361 397
      due to the fact that the latest (even nightly) version of run-jetty-run uses 
......
433 469
      <version>${cdmlib.version}</version>
434 470
      <scope>test</scope>
435 471
    </dependency>
472
    <dependency>
473
      <groupId>eu.etaxonomy</groupId>
474
      <artifactId>cdmlib-db</artifactId>
475
      <version>${cdmlib.version}</version>
476
      <scope>test</scope>
477
    </dependency>
436 478
    <dependency>
437 479
      <!-- adding itextpdf is required to fix dependency problems: itextpdf 
438 480
        is an managed transitive dependency of cdmlib-io without adding it here mvn 
......
463 505
          <artifactId>spring-mock</artifactId>
464 506
        </exclusion>
465 507
      </exclusions>
466
      <scope>provided</scope>
508
      <scope>test</scope>
467 509
    </dependency>
468 510
    <dependency>
469 511
      <groupId>com.thoughtworks.xstream</groupId>
470 512
      <artifactId>xstream</artifactId>
471 513
      <version>1.4.7</version>
472
      <scope>provided</scope>
514
      <scope>test</scope>
473 515
    </dependency>
474 516
    <dependency>
475 517
      <groupId>org.springframework</groupId>
476 518
      <artifactId>spring-mock</artifactId>
477 519
      <version>2.0.8</version>
478
      <scope>provided</scope>
520
      <scope>test</scope>
479 521
    </dependency>
480 522
    <dependency>
481 523
      <groupId>org.springframework</groupId>
482 524
      <artifactId>spring-context-support</artifactId>
483 525
      <version>${spring.version}</version>
484
      <scope>provided</scope>
526
      <scope>test</scope>
485 527
    </dependency>
486 528
    <dependency>
487 529
      <groupId>org.springframework</groupId>
......
509 551
      <groupId>org.slf4j</groupId>
510 552
      <artifactId>slf4j-log4j12</artifactId>
511 553
      <version>1.7.2</version>
512
      <scope>provided</scope>
554
      <scope>test</scope>
513 555
    </dependency>
514 556
    <dependency>
515 557
      <groupId>org.slf4j</groupId>
516 558
      <artifactId>slf4j-api</artifactId>
517 559
      <version>1.7.2</version>
518
      <scope>provided</scope>
560
      <scope>test</scope>
519 561
    </dependency>
520 562
    <dependency>
521 563
      <groupId>org.json</groupId>
src/test/resources/etc/jetty/jetty-http.xml
1
<?xml version="1.0"?>
2
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
3

  
4
<!-- ============================================================= -->
5
<!-- Configure the Jetty Server instance with an ID "Server"       -->
6
<!-- by adding a HTTP connector.                                   -->
7
<!-- This configuration must be used in conjunction with jetty.xml -->
8
<!-- ============================================================= -->
9
<Configure id="Server" class="org.eclipse.jetty.server.Server">
10

  
11
  <!-- =========================================================== -->
12
  <!-- Add a HTTP Connector.                                       -->
13
  <!-- Configure an o.e.j.server.ServerConnector with a single     -->
14
  <!-- HttpConnectionFactory instance using the common httpConfig  -->
15
  <!-- instance defined in jetty.xml                               -->
16
  <!--                                                             -->
17
  <!-- Consult the javadoc of o.e.j.server.ServerConnector and     -->
18
  <!-- o.e.j.server.HttpConnectionFactory for all configuration    -->
19
  <!-- that may be set here.                                       -->
20
  <!-- =========================================================== -->
21
  <Call name="addConnector">
22
    <Arg>
23
      <New class="org.eclipse.jetty.server.ServerConnector">
24
        <Arg name="server"><Ref refid="Server" /></Arg>
25
        <Arg name="factories">
26
          <Array type="org.eclipse.jetty.server.ConnectionFactory">
27
            <Item>
28
              <New class="org.eclipse.jetty.server.HttpConnectionFactory">
29
                <Arg name="config"><Ref refid="httpConfig" /></Arg>
30
              </New>
31
            </Item>
32
          </Array>
33
        </Arg>
34
        <Set name="host"><Property name="jetty.host" /></Set>
35
        <Set name="port"><Property name="jetty.port" default="9180" /></Set>
36
        <Set name="idleTimeout"><Property name="http.timeout" default="30000"/></Set>
37
      </New>
38
    </Arg>
39
  </Call>
40

  
41
</Configure>
src/test/resources/etc/jetty/jetty-https.xml
1
<?xml version="1.0"?>
2
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
3
 
4
<!-- ============================================================= -->
5
<!-- Configure a HTTPS connector.                                  -->
6
<!-- This configuration must be used in conjunction with jetty.xml -->
7
<!-- and jetty-ssl.xml.                                            -->
8
<!-- ============================================================= -->
9
<Configure id="Server" class="org.eclipse.jetty.server.Server">
10
 
11
  <!-- =========================================================== -->
12
  <!-- Add a HTTPS Connector.                                      -->
13
  <!-- Configure an o.e.j.server.ServerConnector with connection   -->
14
  <!-- factories for TLS (aka SSL) and HTTP to provide HTTPS.      -->
15
  <!-- All accepted TLS connections are wired to a HTTP connection.-->
16
  <!--                                                             -->
17
  <!-- Consult the javadoc of o.e.j.server.ServerConnector,        -->
18
  <!-- o.e.j.server.SslConnectionFactory and                       -->
19
  <!-- o.e.j.server.HttpConnectionFactory for all configuration    -->
20
  <!-- that may be set here.                                       -->
21
  <!-- =========================================================== -->
22
  <Call id="httpsConnector" name="addConnector">
23
    <Arg>
24
      <New class="org.eclipse.jetty.server.ServerConnector">
25
        <Arg name="server"><Ref refid="Server" /></Arg>
26
          <Arg name="factories">
27
            <Array type="org.eclipse.jetty.server.ConnectionFactory">
28
              <Item>
29
                <New class="org.eclipse.jetty.server.SslConnectionFactory">
30
                  <Arg name="next">http/1.1</Arg>
31
                  <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
32
                </New>
33
              </Item>
34
              <Item>
35
                <New class="org.eclipse.jetty.server.HttpConnectionFactory">
36
                  <Arg name="config"><Ref refid="sslHttpConfig"/></Arg>
37
                </New>
38
              </Item>
39
            </Array>
40
          </Arg>
41
          <Set name="host"><Property name="jetty.host" /></Set>
42
          <Set name="port"><Property name="https.port" default="9443" /></Set>
43
          <Set name="idleTimeout"><Property name="https.timeout" default="30000"/></Set>
44
        </New>
45
    </Arg>
46
  </Call>
47
</Configure>
src/test/resources/etc/jetty/jetty-ssl.xml
1
<?xml version="1.0"?>
2
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
3
 
4
<!-- ============================================================= -->
5
<!-- Configure a TLS (SSL) Context Factory                         -->
6
<!-- This configuration must be used in conjunction with jetty.xml -->
7
<!-- and either jetty-https.xml or jetty-spdy.xml (but not both)   -->
8
<!-- ============================================================= -->
9
<Configure id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
10
  <Set name="KeyStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.keystore" default="etc/keystore"/></Set>
11
  <Set name="KeyStorePassword"><Property name="jetty.keystore.password" default="OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"/></Set>
12
  <Set name="KeyManagerPassword"><Property name="jetty.keymanager.password" default="OBF:1u2u1wml1z7s1z7a1wnl1u2g"/></Set>
13
  <Set name="TrustStorePath"><Property name="jetty.base" default="." />/<Property name="jetty.truststore" default="etc/keystore"/></Set>
14
  <Set name="TrustStorePassword"><Property name="jetty.truststore.password" default="OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"/></Set>
15
  <Set name="EndpointIdentificationAlgorithm"></Set>
16
  <Set name="ExcludeCipherSuites">
17
    <Array type="String">
18
      <Item>SSL_RSA_WITH_DES_CBC_SHA</Item>
19
      <Item>SSL_DHE_RSA_WITH_DES_CBC_SHA</Item>
20
      <Item>SSL_DHE_DSS_WITH_DES_CBC_SHA</Item>
21
      <Item>SSL_RSA_EXPORT_WITH_RC4_40_MD5</Item>
22
      <Item>SSL_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>
23
      <Item>SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA</Item>
24
      <Item>SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA</Item>
25
    </Array>
26
  </Set>
27
 
28
  <!-- =========================================================== -->
29
  <!-- Create a TLS specific HttpConfiguration based on the        -->
30
  <!-- common HttpConfiguration defined in jetty.xml               -->
31
  <!-- Add a SecureRequestCustomizer to extract certificate and    -->
32
  <!-- session information                                         -->
33
  <!-- =========================================================== -->
34
  <New id="sslHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
35
    <Arg><Ref refid="httpConfig"/></Arg>
36
    <Call name="addCustomizer">
37
      <Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>
38
    </Call>
39
  </New>
40
 
41
</Configure>
src/test/resources/etc/jetty/jetty.xml
1
<?xml version="1.0"?>
2
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
3

  
4
<!-- ============================================================== -->
5
<!-- Sets up characteristics of the org.eclipse.jetty.server.Server -->
6
<!-- instance for the plugin to use. Importantly, it sets up the -->
7
<!-- org.eclipse.jetty.server.HttpConfiguration element that we can -->
8
<!-- refer to in subsequent xml files that configure the connectors -->
9
<!-- ============================================================== -->
10

  
11
<Configure id="Server" class="org.eclipse.jetty.server.Server">
12
	<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
13
		<Set name="secureScheme">http</Set>
14
		<Set name="securePort">
15
			<Property name="jetty.secure.port" default="9443" />
16
		</Set>
17
		<Set name="outputBufferSize">32768</Set>
18
		<Set name="requestHeaderSize">8192</Set>
19
		<Set name="responseHeaderSize">8192</Set>
20
		<Set name="sendServerVersion">true</Set>
21
		<Set name="sendDateHeader">false</Set>
22
		<Set name="headerCacheSize">512</Set>
23
		<!-- Uncomment to enable handling of X-Forwarded- style headers <Call name="addCustomizer"> 
24
			<Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg> 
25
			</Call> -->
26
	</New>
27
</Configure>

Also available in: Unified diff