使用 cxf-codegen-plugin 生成源时,有没有办法去除注释? [英] Is there a way to strip annotations when using the cxf-codegen-plugin for generating sources?
问题描述
我正在使用 cxf-codegen-plugin 从 WSDL 生成一些类.源代码生成后,一堆 bean 被删除(我们不需要它们,只需要服务接口),但是在生成的源代码中有一个 @XmlSeeAlso
注释引用其中的一些已删除类.我们根本不需要 @XmlSeeAlso
注释,有没有办法告诉 cxf-codegen-plugin 在生成源时排除某些注释?
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-plugin
添加标签解决了这个问题,注释掉了所有 @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-plugin 生成源时,有没有办法去除注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!