maven 集成 CXF

Posted 小琪子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven 集成 CXF相关的知识,希望对你有一定的参考价值。

1 今天一直遇到找不到类的错误,可能是POM文件的配置有问题,后面重新在网上找了配置才可以

 

POM配置

<?xml version="1.0" encoding="UTF-8"?>

<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">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.cxf</groupId>
  <artifactId>CXFServer</artifactId>
  <version>1.0</version>
  <packaging>war</packaging>

  <name>CXFServer Maven Webapp</name>
  <url>http://www.example.com</url>

  <properties>
    <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>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
    </dependency>

    <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>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http-jetty</artifactId>
      <version>${cxf.version}</version>
    </dependency>

    <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>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

  

以上是关于maven 集成 CXF的主要内容,如果未能解决你的问题,请参考以下文章

Spring+CXF+Maven发布Webservice

cxf maven 代码生成插件配置

使用apache cxf和maven我得到的代码看起来不正确

spring+cxf 开发webService(主要是记录遇到spring bean注入不进来的解决方法)

java maven cxf笔记

CXF框架介绍及Spring集成