java - Apache CXF WSDL2java pom.xml 配置

标签 java apache maven cxf wsdl2java

基本上我想做的是,我将在资源下创建 wsdl 文件夹,并在其中添加我的 wsdl 文件。每次当我在控制台上运行 mvn clean install 命令时,我期望 cxf 插件从 wsdl 创建 java 文件。

但是,关于 apache cxf 文档,我应用了它所说的内容,但是当我运行 mvngenerate-sources 时没有任何反应(我将使用 mvn clean install 来创建 java 文件,而不是使用 mvngenerate-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>

最佳答案

关于java - Apache CXF WSDL2java pom.xml 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53461623/

相关文章:

php - codeigniter - 升级 php 和 apache 后未找到 fatal error 类 'CI_Controller'

java - 使用maven将jar加载到项目中

Javacpp:无法设法将 libfdk_aac 添加到 ffmpeg 预设

java - Eclipse 中的 LWJGL/opengl

java - J2ME上的音频,不知道哪里错了?

某些请求的 Apache https 请求状态未决,返回 502 状态

apache - 使用 htaccess 从 http 重定向到 https,某些子目录除外

java - 如何使用旧版本的 Maven?

java - JMH vs JMeter 用于基准测试 Java 类?

java - 在 JavaFX 8 DatePicker 中处理 ENTER 键按下