您的位置:首页 > 编程语言 > Java开发

maven+cxf+spring

2015-09-02 14:52 471 查看

maven整合cxf、spring

一、创建maven项目

1.新建maven project


 

 
 二、添加cxf、spring到pom.xml文件

<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">
<modelVersion>4.0.0</modelVersion>
<groupId>cxfDemo</groupId>
<artifactId>cxfDemo</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>cxfDemo Maven Webapp</name>
<url>http://maven.apache.org</url>

<build>
<finalName>cxfDemo</finalName>
</build>
<!-- 定义全局版本号 -->
<properties>
<!-- 		<jre.source.version>1.6</jre.source.version>
<jre.target.version>1.6</jre.target.version> -->
<junit.version>4.11</junit.version>
<cxf.version>2.2.3</cxf.version>
<spring.version>3.2.3.RELEASE</spring.version>
<slf4j.version>1.7.7</slf4j.version>
<servlet.version>2.5</servlet.version>
</properties>
<!-- 定义依赖包-->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>provided</scope>
</dependency>

<!-- CXF Dependencies -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>

</dependency>
<!-- Jetty is needed if you're are not using the CXFServlet -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
<scope>test</scope>
</dependency>
<!-- End of CXF Dependencies -->

<!-- Spring Dependencies ${spring.version} -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

</dependencies>

</project>

 

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: