简体   繁体   English

Ant WsImport在Gradle中编译生成的Java文件期间引发错误

[英]Ant WsImport throwing errors during compiling generated java files in gradle

I am generating web service clients using gradle ant wsimport task and packaging the clients with -clientJar option with -xnocompile set to false . 我正在使用gradle ant wsimport任务生成Web服务客户端,并使用-clientJar选项(将-xnocompile设置为false)打包客户端。

During the compilation of generated Java code by xcompile option, its throwing an exception ( [ant:wsimport] compilation failed, errors should have been reported ) due to the dependencies (Package abc.customDateAdapter does not exist) on the generated java files are not resolved. 在通过xcompile选项编译生成的Java代码的过程中,由于对生成的Java文件的依赖关系(程序包abc.customDateAdapter不存在) ,其抛出异常( [ant:wsimport]编译失败,应该报告了错误 。解决。

I am supplying a jaxb Global Binding file to wsimport task in which i have customized the xsd:date bindings with my customDateAdapter. 我向wsimport任务提供了一个jaxb全局绑定文件,在其中我用customDateAdapter自定义了xsd:date绑定。 The package import of the customDateAdapter is not resolved on the generated Java files during ant wsimport. ant wsimport期间,在生成的Java文件上未解析customDateAdapter的包导入。

The unresolved customDateAdapter package is in projectA which is compile time and buildscript classpath dependency for the current project. 尚未解决的customDateAdapter包位于projectA中,它是当前项目的编译时间和buildscript类路径依赖项。 But still the ant wsimport is not picking up the classpath dependency during compiling the generated java files. 但是,在编译生成的Java文件的过程中,ant wsimport仍然没有选择classpath依赖项。

Can someone please suggest how to add an external project as classpath dependency to ant wsimport task. 有人可以建议如何将外部项目作为类路径依赖项添加到ant wsimport任务。

I have figured out the issue on my own. 我自己解决了这个问题。

Created the custom dependency configuration for ant wsImport and declared the required jars, with which the ant compilation works fine as expected. 为ant wsImport创建了自定义依赖项配置,并声明了所需的jar,使ant编译可以按预期正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM