java - Apache CXF WSDL2java pom.xml 配置
问题描述
基本上我想做的是我将在资源下创建 wsdl 文件夹,并将我的 wsdl 文件添加到其中。每次我在控制台上运行 mvn clean install 命令时,我对 cxf 插件的期望是从 wsdl 创建 java 文件。
但是,关于 apache cxf 文档,我应用了它所说的内容,但是当我运行 mvn generate-sources 时没有任何反应(如果您有任何建议,我将使用 mvn clean install 来创建 java 文件,而不是使用 mvn generate-sources 下一步也会很棒)。
这段代码有什么问题?
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.erkan</groupId>
<artifactId>wsClient</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>wsClient</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.mojo/jaxws-maven-plugin -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>3.2.7</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/is.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/main/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
解决方案
推荐阅读
- php - PHP codeigniter 不返回对 POST 调用的响应
- linux - 尝试在linux中卷曲文件并赋予其执行权限然后移动它时的选项无效
- java - 是否可以恢复 PBKDF2 哈希密码?
- typescript - 如何在 Openlayers 中的 DragAndDrop 上使用 GeoJson 作为 Formatconstructor
- javascript - 我需要计算连续零的数量并用这样的计数更新新数组。每个这样的零块都必须单独计算
- python - 单列到多列,列作为标题并填充二进制值
- firebase - 如何动态地将一组地图添加到云火库中?
- r - dplyr 包中的不同功能
- html - 如何在html中的链接中嵌入源站地址?
- azure - Azure - 创建多个具有静态地址的虚拟机 - 冲突