Merge branch 'nguyennamthai-cxf_intro'

This commit is contained in:
Zeger Hendrikse 2016-07-13 09:47:04 +02:00
commit b426599e04
4 changed files with 62 additions and 72 deletions

View File

@ -10,9 +10,28 @@
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>
<skipTests>true</skipTests>
<cxf.version>3.1.6</cxf.version> <cxf.version>3.1.6</cxf.version>
</properties> </properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>com.baeldung.cxf.introduction.Server</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<excludes>
<exclude>**/StudentTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
@ -25,29 +44,4 @@
<version>${cxf.version}</version> <version>${cxf.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<profiles>
<profile>
<id>server</id>
<build>
<defaultGoal>test</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.baeldung.cxf.introduction.Server</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> </project>

View File

@ -3,15 +3,11 @@ package com.baeldung.cxf.introduction;
import javax.xml.ws.Endpoint; import javax.xml.ws.Endpoint;
public class Server { public class Server {
private Server() { public static void main(String args[]) throws InterruptedException {
BaeldungImpl implementor = new BaeldungImpl(); BaeldungImpl implementor = new BaeldungImpl();
String address = "http://localhost:8080/baeldung"; String address = "http://localhost:8080/baeldung";
Endpoint.publish(address, implementor); Endpoint.publish(address, implementor);
} System.out.println("Server ready...");
public static void main(String args[]) throws InterruptedException {
new Server();
System.out.println("Server ready");
Thread.sleep(60 * 1000); Thread.sleep(60 * 1000);
System.out.println("Server exiting"); System.out.println("Server exiting");
System.exit(0); System.exit(0);

View File

@ -21,7 +21,7 @@ public class StudentTest {
private Service service; private Service service;
private Baeldung baeldungProxy; private Baeldung baeldungProxy;
private Baeldung baeldungImpl; private BaeldungImpl baeldungImpl;
{ {
service = Service.create(SERVICE_NAME); service = Service.create(SERVICE_NAME);

View File

@ -1,40 +1,40 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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"> 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> <modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>apache-cxf</artifactId> <artifactId>apache-cxf</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>cxf-introduction</module> <module>cxf-introduction</module>
</modules> </modules>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>4.12</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<defaultGoal>install</defaultGoal> <defaultGoal>install</defaultGoal>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version> <version>3.5.1</version>
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version> <version>1.5.0</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </build>
</project> </project>