有没有办法使用cxf- codeGEN-插件生成源时剥离的注解? [英] Is there a way to strip annotations when using the cxf-codegen-plugin for generating sources?

查看:156
本文介绍了有没有办法使用cxf- codeGEN-插件生成源时剥离的注解?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 cxf- codeGEN-插件生成从WSDL一些类。生成了源代码后,一堆豆子被删除(我们不需要他们,只是服务接口),但在生成的源代码的 @XmlSeeAlso 注释引用一些删除类。我们不需要在 @XmlSeeAlso 标注可言,有没有办法告诉cxf- codeGEN-插件生成源时,排除某些注解?

I'm using the cxf-codegen-plugin to generate some classes from a WSDL. After the sources are generated, a bunch of beans get deleted (we don't need them, just the service interfaces), but there is an @XmlSeeAlso annotation in the generated source that references some of these deleted classes. We don't need the @XmlSeeAlso annotation at all, is there a way to tell the cxf-codegen-plugin to exclude certain annotations when generating sources?

推荐答案

我解决了这个通过添加标签到 Maven的antrun-插件,注释掉所有 @XmlSeeAlso 实例:

I solved this by adding a tag to a maven-antrun-plugin, commenting out all the @XmlSeeAlso instances:

<target>
    <replace file="${basedir}/target/generated-sources/x/x/x/Service.java" token="@XmlSeeAlso" value="//@XmlSeeAlso" />
</target>

这篇关于有没有办法使用cxf- codeGEN-插件生成源时剥离的注解?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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