繁体   English   中英

我想在每个使用org.codehaus.mojo jaxb2-maven-plugin插件生成的JAXB生成的文件中添加一行注释

[英]I want to add a single line comment in each JAXB generated file that have been generated using the org.codehaus.mojo jaxb2-maven-plugin plugin

我正在使用XJC org.codehaus.mojo从XSD生成JAXB类jaxb2-maven-plugin 2.2

我想在每个生成文件的顶部添加一行注释,最简单的方法是什么?

com.google.code.maven-replacer-plugin替换器1.5.2 prepare-package替换

                <basedir>${project.build.sourceDirectory}/com/deltarail/nexus/cis/map/jaxb/generated</basedir>

                <includes>                       
                    <include>*.java</include>                            
                </includes>      

                <replacements>
                    <replacement>
                        <token>// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11</token>
                        <value>// CSOFF: a.*</value>                          
                    </replacement>


                <replacement>
                        <token>public class</token>
                        <value>@SuppressWarnings("PMD")
public class</value>                          
                    </replacement>


                </replacements>
                <regex>false</regex>
            </configuration>
        </plugin>

暂无
暂无

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

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