Przeglądaj źródła

Load app.properties from current dir first, then from root of classpath if not found, which makes it possible to both run in development mode inside the IDE and to edit the file to point at any WSDL URL in distributed mode.

Assembly of a nice zip file which can be unpacked and run with java -jar IncidentLoggingAplication.jar
peter_backlund 18 lat temu
rodzic
commit
df1f13a62f

+ 34
- 0
register-app/assembly.xml Wyświetl plik

@@ -0,0 +1,34 @@
1
+<?xml version="1.0"?>
2
+
3
+<assembly xmlns="http://maven.apache.org/POM/4.0.0"
4
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
+          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
6
+
7
+    <formats>
8
+        <format>zip</format>
9
+    </formats>
10
+    <includeBaseDirectory>true</includeBaseDirectory>
11
+  
12
+    <files>
13
+        <file>
14
+            <source>src/main/resources/app.properties</source>
15
+            <destName>app.properties</destName>
16
+        </file>
17
+    </files>
18
+
19
+    <dependencySets>
20
+      <dependencySet>
21
+        <excludes>
22
+          <exclude>se.citerus:register-app</exclude>
23
+        </excludes>
24
+        <outputDirectory>lib</outputDirectory>
25
+      </dependencySet>
26
+      <dependencySet>
27
+        <includes>
28
+          <include>se.citerus:register-app</include>
29
+        </includes>
30
+        <outputFileNameMapping>IncidentLoggingApplication.${artifact.extension}</outputFileNameMapping>
31
+      </dependencySet>
32
+    </dependencySets>
33
+
34
+</assembly>

+ 26
- 14
register-app/pom.xml Wyświetl plik

@@ -1,4 +1,8 @@
1
-<?xml version="1.0" encoding="UTF-8"?><project>
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+
2 6
   <modelVersion>4.0.0</modelVersion>
3 7
   <groupId>se.citerus</groupId>
4 8
   <artifactId>register-app</artifactId>
@@ -21,6 +25,8 @@
21 25
           <archive>
22 26
             <manifest>
23 27
               <mainClass>se.citerus.App</mainClass>
28
+              <addClasspath>true</addClasspath>
29
+              <classpathPrefix>lib</classpathPrefix>
24 30
             </manifest>
25 31
           </archive>
26 32
         </configuration>
@@ -28,14 +34,10 @@
28 34
       <plugin>
29 35
         <artifactId>maven-assembly-plugin</artifactId>
30 36
         <configuration>
31
-          <descriptorRefs>
32
-            <descriptorRef>jar-with-dependencies</descriptorRef>
33
-          </descriptorRefs>
34
-          <archive>
35
-            <manifest>
36
-              <mainClass>se.citerus.App</mainClass>
37
-            </manifest>
38
-          </archive>
37
+          <descriptors>
38
+            <descriptor>assembly.xml</descriptor>
39
+          </descriptors>
40
+          <finalName>IncidentLoggingApplication</finalName>
39 41
         </configuration>
40 42
       </plugin>
41 43
     </plugins>
@@ -63,8 +65,18 @@
63 65
     </dependency>
64 66
     <dependency>
65 67
       <groupId>org.springframework</groupId>
66
-      <artifactId>spring</artifactId>
67
-      <version>2.5</version>
68
+      <artifactId>spring-context</artifactId>
69
+      <version>2.5.5</version>
70
+    </dependency>
71
+    <dependency>
72
+      <groupId>org.springframework</groupId>
73
+      <artifactId>spring-web</artifactId>
74
+      <version>2.5.5</version>
75
+    </dependency>
76
+    <dependency>
77
+      <groupId>org.springframework</groupId>
78
+      <artifactId>spring-aop</artifactId>
79
+      <version>2.5.5</version>
68 80
     </dependency>
69 81
     <dependency>
70 82
       <groupId>com.jgoodies</groupId>
@@ -96,7 +108,7 @@
96 108
           <groupId>org.springframework</groupId>
97 109
         </exclusion>
98 110
         <exclusion>
99
-          <artifactId>spring-hibernate3</artifactId>
111
+          <artifactId>spring-orm</artifactId>
100 112
           <groupId>org.springframework</groupId>
101 113
         </exclusion>
102 114
         <exclusion>
@@ -108,11 +120,11 @@
108 120
           <groupId>org.springframework</groupId>
109 121
         </exclusion>
110 122
         <exclusion>
111
-          <artifactId>spring-mock</artifactId>
123
+          <artifactId>spring-context</artifactId>
112 124
           <groupId>org.springframework</groupId>
113 125
         </exclusion>
114 126
         <exclusion>
115
-          <artifactId>spring-context</artifactId>
127
+          <artifactId>spring-jms</artifactId>
116 128
           <groupId>org.springframework</groupId>
117 129
         </exclusion>
118 130
         <exclusion>

+ 13
- 8
register-app/src/main/resources/context-app.xml Wyświetl plik

@@ -1,15 +1,19 @@
1 1
 <?xml version="1.0"?>
2 2
 
3 3
 <beans xmlns="http://www.springframework.org/schema/beans"
4
-       xmlns:tx="http://www.springframework.org/schema/tx"
5 4
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
-       xsi:schemaLocation="
7
-        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
8
-        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
9
-       xmlns:context="http://www.springframework.org/schema/context">
5
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
6
+
7
+  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
8
+    <property name="locations" value="file:app.properties"/>
9
+    <property name="order" value="1"/>
10
+    <property name="ignoreResourceNotFound" value="true"/>
11
+    <property name="ignoreUnresolvablePlaceholders" value="true"/>
12
+  </bean>
10 13
 
11 14
   <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
12 15
     <property name="locations" value="classpath:app.properties"/>
16
+    <property name="order" value="2"/>
13 17
   </bean>
14 18
 
15 19
   <bean id="registerApp" class="se.citerus.registerapp.RegisterApp">
@@ -22,10 +26,11 @@
22 26
   </bean>
23 27
 
24 28
   <bean id="handlingEventWebServiceEndPoint" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
25
-    <property name="serviceInterface" value="se.citerus.dddsample.ws.HandlingEventServiceEndpoint" />
29
+    <property name="serviceInterface" value="se.citerus.dddsample.application.ws.HandlingEventServiceEndpoint" />
26 30
     <property name="wsdlDocumentUrl" value="${wsdl.url}" />
27
-    <property name="namespaceUri" value="http://ws.dddsample.citerus.se/" />
31
+    <property name="namespaceUri" value="http://ws.application.dddsample.citerus.se/" />
28 32
     <property name="serviceName" value="HandlingEventServiceEndpointImplService" />
29 33
     <property name="portName" value="HandlingEventServiceEndpointImplPort" />
30 34
   </bean>
31
-</beans>
35
+
36
+</beans>