java应用maven插件动态生成webservice代码分析

不点 阅读:201 2021-07-15 18:32:20 评论:0

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.wisdombud</groupId> 
    <artifactId>com.wisdombud.ws</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
 
    <properties> 
        <guava.version>14.0.1</guava.version> 
        <spring.version>3.0.6.RELEASE</spring.version> 
        <cxf.version>2.7.5</cxf.version> 
        <junit.version>4.8.1</junit.version> 
        <slf4j.version>1.6.2</slf4j.version> 
        <struts.version>2.2.3.1</struts.version> 
        <zyzxbm.version>0.0.1-SNAPSHOT</zyzxbm.version> 
    </properties> 
 
    <build> 
        <plugins> 
 
            <plugin> 
                <groupId>org.apache.cxf</groupId> 
                <artifactId>cxf-codegen-plugin</artifactId> 
                <version>${cxf.version}</version> 
                <executions> 
                    <execution> 
                        <id>generate-sources</id> 
                        <phase>generate-sources</phase> 
                        <configuration> 
                            <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot> 
                            <wsdlOptions> 
                                <wsdlOption> 
                                    <wsdl>http://172.16.20.100/humiture/overt/MsgManager?wsdl</wsdl> 
                                </wsdlOption> 
                            </wsdlOptions> 
                        </configuration> 
                        <goals> 
                            <goal>wsdl2java</goal> 
                        </goals> 
                    </execution> 
                </executions> 
            </plugin> 
        </plugins> 
        <pluginManagement> 
            <plugins> 
                <plugin> 
                    <groupId>org.eclipse.m2e</groupId> 
                    <artifactId>lifecycle-mapping</artifactId> 
                    <version>1.0.0</version> 
                    <configuration> 
                        <lifecycleMappingMetadata> 
                            <pluginExecutions> 
                                <pluginExecution> 
                                    <pluginExecutionFilter> 
                                        <groupId>org.apache.cxf</groupId> 
                                        <artifactId>cxf-java2ws-plugin</artifactId> 
                                        <versionRange>[2.4.3,)</versionRange> 
                                        <goals> 
                                            <goal>java2ws</goal> 
                                        </goals> 
                                    </pluginExecutionFilter> 
                                    <action> 
                                        <ignore /> 
                                    </action> 
                                </pluginExecution> 
                                <pluginExecution> 
                                    <pluginExecutionFilter> 
                                        <groupId>org.apache.cxf</groupId> 
                                        <artifactId>cxf-codegen-plugin</artifactId> 
                                        <versionRange>[2.7.5,)</versionRange> 
                                        <goals> 
                                            <goal>wsdl2java</goal> 
                                        </goals> 
                                    </pluginExecutionFilter> 
                                    <action> 
                                        <ignore /> 
                                    </action> 
                                </pluginExecution> 
                            </pluginExecutions> 
                        </lifecycleMappingMetadata> 
                    </configuration> 
                </plugin> 
            </plugins> 
        </pluginManagement> 
    </build> 
</project>

标签:java
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

发表评论
搜索
KIKK导航

KIKK导航

排行榜
关注我们

一个IT知识分享的公众号