maven+cxf+spring

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>

 

猜你喜欢

转载自568025297.iteye.com/blog/2240292