Skip to content

Commit 01ee371

Browse files
committed
Migrating Airline sample to maven
1 parent b98b261 commit 01ee371

File tree

64 files changed

+122
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+122
-96
lines changed

samples/airline/client/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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/maven-v4_0_0.xsd">
3+
<parent>
4+
<artifactId>airline</artifactId>
5+
<groupId>org.springframework.ws</groupId>
6+
<version>2.0.0-M1-SNAPSHOT</version>
7+
<relativePath>../pom.xml</relativePath>
8+
</parent>
9+
<modelVersion>4.0.0</modelVersion>
10+
<artifactId>airline-client</artifactId>
11+
<packaging>pom</packaging>
12+
<name>Spring WS Airline Sample - Clients</name>
13+
<modules>
14+
<module>saaj</module>
15+
</modules>
16+
</project>
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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/maven-v4_0_0.xsd">
3+
<parent>
4+
<artifactId>airline-client</artifactId>
5+
<groupId>org.springframework.ws</groupId>
6+
<version>2.0.0-M1-SNAPSHOT</version>
7+
<relativePath>../pom.xml</relativePath>
8+
</parent>
9+
<modelVersion>4.0.0</modelVersion>
10+
<artifactId>airline-saaj-client</artifactId>
11+
<packaging>jar</packaging>
12+
<name>Spring WS Airline Sample - SAAJ Client</name>
13+
<profiles>
14+
<profile>
15+
<id>jdk15</id>
16+
<activation>
17+
<jdk>!1.6</jdk>
18+
</activation>
19+
<dependencies>
20+
<dependency>
21+
<groupId>javax.xml.soap</groupId>
22+
<artifactId>saaj-api</artifactId>
23+
<scope>compile</scope>
24+
</dependency>
25+
<dependency>
26+
<groupId>com.sun.xml.messaging.saaj</groupId>
27+
<artifactId>saaj-impl</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>javax.activation</groupId>
31+
<artifactId>activation</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>com.sun.org.apache.xml.security</groupId>
35+
<artifactId>xmlsec</artifactId>
36+
</dependency>
37+
</dependencies>
38+
</profile>
39+
</profiles>
40+
<repositories>
41+
<repository>
42+
<id>java.net</id>
43+
<name>Java.net Repository for Maven2</name>
44+
<url>http://download.java.net/maven/1/</url>
45+
<layout>legacy</layout>
46+
</repository>
47+
</repositories>
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>org.codehaus.mojo</groupId>
52+
<artifactId>exec-maven-plugin</artifactId>
53+
<executions>
54+
<execution>
55+
<goals>
56+
<goal>java</goal>
57+
</goals>
58+
</execution>
59+
</executions>
60+
<configuration>
61+
<mainClass>org.springframework.ws.samples.airline.client.saaj.GetFlights</mainClass>
62+
</configuration>
63+
</plugin>
64+
</plugins>
65+
</build>
66+
<dependencies>
67+
<dependency>
68+
<groupId>com.sun.xml.wss</groupId>
69+
<artifactId>xws-security</artifactId>
70+
</dependency>
71+
</dependencies>
72+
</project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private void writeGetFlightsResponse(SOAPMessage message) throws SOAPException,
117117
}
118118

119119
public static void main(String[] args) throws Exception {
120-
String url = "http://localhost:8080/airline/services";
120+
String url = "http://localhost:8080/airline-server/services";
121121
if (args.length > 0) {
122122
url = args[0];
123123
}
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,13 @@ public void getMileage(String username, String password) throws SOAPException, I
128128
}
129129

130130
public static void main(String[] args) throws Exception {
131-
String url = "http://localhost:8080/airline/services";
132-
if (args.length < 2) {
133-
System.err.println(
134-
"Usage: java org.springframework.ws.samples.airline.client.saaj.GetFrequentFlyerMileage " +
135-
"username password [url]");
136-
}
137-
String username = args[0];
138-
String password = args[1];
139-
if (args.length > 2) {
140-
url = args[2];
131+
if (!System.getProperty("java.version").startsWith("1.5")) {
132+
System.out.println("This sample will only run under JDK 1.5");
133+
return;
141134
}
135+
String url = "http://localhost:8080/airline-server/services";
136+
String username = "john";
137+
String password = "changeme";
142138
GetFrequentFlyerMileage getMileage = new GetFrequentFlyerMileage(url);
143139
getMileage.getMileage(username, password);
144140
}

samples/airline/pom.xml renamed to samples/airline/server/pom.xml

Lines changed: 23 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<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/maven-v4_0_0.xsd">
22
<parent>
3-
<artifactId>spring-ws-samples</artifactId>
3+
<artifactId>airline</artifactId>
44
<groupId>org.springframework.ws</groupId>
55
<version>2.0.0-M1-SNAPSHOT</version>
6-
<relativePath>../samples/pom.xml</relativePath>
6+
<relativePath>../pom.xml</relativePath>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
9-
<artifactId>airline</artifactId>
9+
<artifactId>airline-server</artifactId>
1010
<packaging>war</packaging>
11-
<name>Spring WS Airline Sample</name>
11+
<name>Spring WS Airline Sample - Server</name>
1212
<profiles>
1313
<profile>
1414
<id>jdk15</id>
@@ -56,90 +56,43 @@
5656
</profile>
5757
</profiles>
5858
<repositories>
59-
<repository>
60-
<id>java.net</id>
61-
<name>Java.net Repository for Maven2</name>
62-
<url>http://download.java.net/maven/1/</url>
63-
<layout>legacy</layout>
64-
</repository>
6559
<repository>
6660
<id>spring-ext</id>
6761
<name>Spring External Dependencies Repository</name>
6862
<url>https://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/</url>
6963
</repository>
7064
</repositories>
71-
<reporting>
72-
<plugins>
73-
<plugin>
74-
<artifactId>maven-javadoc-plugin</artifactId>
75-
<configuration>
76-
<stylesheetfile>${basedir}/../../src/main/javadoc/javadoc.css</stylesheetfile>
77-
</configuration>
78-
</plugin>
79-
</plugins>
80-
</reporting>
81-
<pluginRepositories>
82-
<pluginRepository>
83-
<id>java.net</id>
84-
<name>Java.net Repository for Maven2</name>
85-
<url>http://download.java.net/maven/1/</url>
86-
<layout>legacy</layout>
87-
</pluginRepository>
88-
</pluginRepositories>
8965
<build>
90-
<resources>
91-
<resource>
92-
<directory>src/main/resources</directory>
93-
<includes>
94-
<include>**/*.properties</include>
95-
</includes>
96-
<filtering>true</filtering>
97-
</resource>
98-
<resource>
99-
<directory>src/main/resources</directory>
100-
<excludes>
101-
<exclude>**/*.properties</exclude>
102-
</excludes>
103-
<filtering>false</filtering>
104-
</resource>
105-
</resources>
10666
<plugins>
10767
<plugin>
108-
<groupId>org.apache.maven.plugins</groupId>
109-
<artifactId>maven-compiler-plugin</artifactId>
110-
<configuration>
111-
<source>1.5</source>
112-
<target>1.5</target>
113-
</configuration>
114-
</plugin>
115-
<plugin>
116-
<groupId>com.sun.tools.xjc.maven2</groupId>
117-
<artifactId>maven-jaxb-plugin</artifactId>
68+
<groupId>org.codehaus.mojo</groupId>
69+
<artifactId>jaxb2-maven-plugin</artifactId>
11870
<executions>
11971
<execution>
120-
<phase>generate-sources</phase>
12172
<goals>
122-
<goal>generate</goal>
73+
<goal>xjc</goal>
12374
</goals>
12475
</execution>
125-
</executions>
76+
</executions>
77+
<configuration>
78+
<schemaDirectory>src/main/webapp/</schemaDirectory>
79+
<packageName>org.springframework.ws.samples.airline.schema</packageName>
80+
</configuration>
81+
</plugin>
82+
<plugin>
83+
<groupId>org.codehaus.mojo</groupId>
84+
<artifactId>openjpa-maven-plugin</artifactId>
85+
<version>1.0</version>
12686
<configuration>
127-
<generatePackage>org.springframework.ws.samples.airline.schema</generatePackage>
128-
<schemaDirectory>src/main/webapp/</schemaDirectory>
87+
<includes>org/springframework/ws/samples/airline/domain/*.class</includes>
88+
<excludes>org/springframework/ws/samples/airline/domain/ServiceClass.class</excludes>
12989
</configuration>
130-
</plugin>
131-
<plugin>
132-
<artifactId>maven-antrun-plugin</artifactId>
13390
<executions>
13491
<execution>
92+
<id>enhancer</id>
13593
<phase>process-classes</phase>
136-
<configuration>
137-
<tasks>
138-
<java classname="org.apache.openjpa.enhance.PCEnhancer" classpathref="maven.runtime.classpath" dir="target/classes" fork="true" />
139-
</tasks>
140-
</configuration>
14194
<goals>
142-
<goal>run</goal>
95+
<goal>enhance</goal>
14396
</goals>
14497
</execution>
14598
</executions>
@@ -246,13 +199,8 @@
246199
<!-- O/R Mapping dependencies -->
247200
<dependency>
248201
<groupId>org.apache.openjpa</groupId>
249-
<artifactId>openjpa-lib</artifactId>
250-
<version>1.0.0</version>
251-
</dependency>
252-
<dependency>
253-
<groupId>org.apache.openjpa</groupId>
254-
<artifactId>openjpa-persistence-jdbc</artifactId>
255-
<version>1.0.0</version>
202+
<artifactId>openjpa</artifactId>
203+
<version>1.2.0</version>
256204
</dependency>
257205
<dependency>
258206
<groupId>commons-dbcp</groupId>
@@ -318,12 +266,6 @@
318266
<artifactId>XmlSchema</artifactId>
319267
</dependency>
320268
<!-- Test dependencies -->
321-
<dependency>
322-
<groupId>org.easymock</groupId>
323-
<artifactId>easymock</artifactId>
324-
<scope>test</scope>
325-
<version>2.2</version>
326-
</dependency>
327269
<dependency>
328270
<groupId>org.springframework.security</groupId>
329271
<artifactId>spring-security-core</artifactId>

0 commit comments

Comments
 (0)