cxf-codegen插件端口到Gradle [英] cxf-codegen-plugin port to Gradle

查看:535
本文介绍了cxf-codegen插件端口到Gradle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图复制这个插件在Gradle中所做的事情。如果我执行:

I'm trying to replicate what this plug-in does in Gradle. If I execute:

./wsdl2java -encoding UTF-8 -d /src/target/generated-sources/cxf -fe jaxws21
-sn UserSoapServicePorts -faultSerialVersionUID 1 -xjc-Xannotate 
-p http:... -p urn:... -p urn:... -p urn:... -p urn:h... -p urn:... 
-p urn:... -p urn:... 
-verbose /src/xmlTemp/user-soap-v1.wsdl 

...然后我得到:

...then I get:

an 22, 2016 3:51:05 PM org.apache.cxf.wsdl11.WSDLServiceBuilder checkForWrapped
INFO: Operation {urn:stuff:wsdl:person:v1}doSomething cannot be unwrapped, input message must reference global element declaration with same localname as operation

据我所知,线条是相同的。任何想法可能是错误的?

As far as I can tell, though the lines are identical. Any ideas what might be wrong?

推荐答案

使用

Use

buildscript {
    ext {
        xjcVersion= '3.0.5'
        jaxbOutputDir = "$buildDir/generated/cxf"
        jaxb2BasicsVersion = '0.11.0'
    }
}

configurations {
    cxf
}

apply plugin: 'java'
apply plugin: 'eclipse'


sourceSets {
    main {
         java {
          srcDirs += "$jaxbOutputDir"
         }
    }
}

task wsdl2java(type: JavaExec) {
    ext {
         outputDir = file("$jaxbOutputDir")
    }   
    systemProperties  = ['javax.xml.accessExternalSchema': 'file' , 'file.encoding':'UTF8']
    outputs.upToDateWhen { false }
    outputs.dir outputDir
    main = 'org.apache.cxf.tools.wsdlto.WSDLToJava'
    classpath = project.configurations.cxf
    args '-d', outputDir
    args '-fe', 'jaxws21'
    args '-client'
    args '-verbose'
    args '-validate'
    args '-mark-generated'
//  args '-xjc-X'
    args '-xjc-Xfluent-api'
    args '-xjc-Xts'
    args '-xjc-XhashCode'
    args '-xjc-Xequals'
    args '-b',"$projectDir/src/main/resources/jaxws-custom-bindings.xjb" 
    args "$projectDir/src/main/resources/wsdl/myWsdl.wsdl"
    doLast {
         println "----- cxf jaxb2 files generated -----"
    }
}

 dependencies {
    cxf "org.apache.cxf:cxf-tools-wsdlto-core:$cxfVersion"
    cxf "org.apache.cxf:cxf-tools-wsdlto-frontend-jaxws:$cxfVersion"
    cxf "org.apache.cxf:cxf-tools-wsdlto-databinding-jaxb:$cxfVersion"

    cxf "org.jvnet.jaxb2_commons:jaxb2-fluent-api:3.0"
    cxf "org.apache.cxf.xjcplugins:cxf-xjc-ts:$xjcVersion"

    cxf "org.jvnet.jaxb2_commons:jaxb2-basics:$jaxb2BasicsVersion"

    compile "org.apache.cxf.xjc-utils:cxf-xjc-runtime:$xjcVersion"
    compile "org.jvnet.jaxb2_commons:jaxb2-basics-runtime:$jaxb2BasicsVersion"
    compile 'commons-lang:commons-lang:2.6'
 }

compileJava.dependsOn wsdl2java

很有趣。

这篇关于cxf-codegen插件端口到Gradle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆