gradle - xsd2java-no.nils.wsdl2java

标签 gradle xsd jaxb2 wsdl2java

我正在按照下面的教程使用Gradle生成Xsd2Java

https://github.com/nilsmagnus/wsdl2java

我想知道如何将命令行参数传递给ant.xjc任务。

这是我的示例,但似乎没有使用我的3参数([extension:true],[value:'-Xtbs'])

xsd2java {
   def contractDir = "$buildDir/extractedContracts"
   File perContract = new File("$contractDir/Enterprise.xsd")
   File adContract = new File("$contractDir/AdFpc.xsd")
   File adListContract = new File("$contractDir/AdListData.xsd")

  xsdsToGenerate = [
   [file("$perContract"), 'com.performance.contract',[extension: true], [ value: '-Xtbs']],
   [file("$adContract"), 'ad.contract',[extension: true],[value: '-Xtbs']],
   [file("$adListContract"), 'ad.list.contract',[extension: true], [value: '-Xtbs']],
  ]
  generatedXsdDir = file(project.ext.generatedSrcDir)
}

-xtbs生成toString,哈希码和equals方法

有没有人对xsd2java有任何建议或示例

谢谢

最佳答案

I would like to know how can i pass command line argument to ant.xjc task.



description of the ant-task for xjc中,您可以找到以下引号:

arg

Additional command line arguments passed to the XJC. For details about the syntax, see the relevant section in the Ant manual. This nested element can be used to specify various options not natively supported in the xjc Ant task. For example, currently there is no native support for the following xjc command-line options:

  • nv
  • use-runtime
  • schema
  • dtd
  • relaxng
  • Xlocator
  • Xsync-methods


在上面提到的relevant section中,有足够的示例说明了如何执行此操作。

关于gradle - xsd2java-no.nils.wsdl2java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32576968/

相关文章:

php - 使用 PHP 将 XML 模式默认值注入(inject)到文档中

Java 6 和 JaxB 2.1

jaxb - 为什么从 JAXB 引用实现中删除了 AnnotationReader?

gradle - 在运行测试之前如何运行应用程序(gradle/kotlin/spring引导)

android - Android Studio无法使用外部库启动应用程序

android - 如何在我的gradle脚本中设置Android v3.0.1?

java - com.sun.istack.SAXException2 : Instance . .. 正在替换 "java.lang.Object",但是 ... 绑定(bind)到匿名类型

gradle - 在 Gradle 中为特定任务设置 javaagent

java - 如何让 JAXB 解析 BigInteger 的科学记数法?

xml - 带有导入和 namespace 的 XSD