码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2014-11-27 17:44:19      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   sp   java   on   

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应用maven插件动态生成webservice代码

标签:style   blog   http   io   ar   color   sp   java   on   

原文地址:http://www.cnblogs.com/wardensky/p/4126729.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!