2011-08-01 121 views
7

的生成上...在Java中的文件,我想獲得的maven-jaxb2-plugin做不寫了「免責聲明」:跳過使用JAXB2 Maven插件

This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.2-hudson-jaxb-ri-2.2-63- 
See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
Any modifications to this file will be lost upon recompilation of the source schema. 
Generated on: 2011.08.01 at 09:20:43 AM CEST 

至少時間戳。

謝謝。

Udo。

回答

8

使用-no-header如果您使用命令行源生成器或header='false'如果您使用ant。

在POM,在配置<args><arg>-no-header</arg></args>

+0

添加到你的答案,在POM中,在配置 -no-header ssedano

+0

正是我在找的東西。這個網站真的很棒! – julien

8

我想補充,我使用Maven和什麼工作對我來說是:

<arguments>-no-header</arguments> 
+1

與'一起使用org.codehaus.mojo jaxb2-maven-plugin 1.5' –

2

使用 「noGeneratedHeaderComments」 例如:

  <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>jaxb2-maven-plugin</artifactId> 
      <version>2.1</version> 
      <executions> 
       <execution> 
        <id>xjc</id> 
        <goals> 
         <goal>xjc</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <outputDirectory>${project.basedir}/src/main/java</outputDirectory> 
       <clearOutputDir>false</clearOutputDir> 
       <sources> 
        <source>${project.basedir}/src/main/resources/xsd</source> 
       </sources>  
       <noGeneratedHeaderComments>true</noGeneratedHeaderComments> 
      </configuration> 
     </plugin>