mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
106 stars 77 forks source link

noGeneratedHeaderComments for episode files #113

Closed pludov closed 5 years ago

pludov commented 6 years ago

I am trying to remove comments including generation date from generated sources (in an effort to achieve deterministic builds). However, the noGeneratedHeaderComments config option seems to not target the episode file. I end up with a file in WEB-INF/classes/META-INF/JAXB/episode_default.xjb with the following content:

<?xml` version="1.0" encoding="UTF-8" standalone="yes"?> 
 <bindings version="2.1" xmlns="http://java.sun.com/xml/ns/jaxb">
  <!--

This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0.1 
See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> 
Any modifications to this file will be lost upon recompilation of the source schema. 
Generated on: 2018.06.28 at 06:05:28 PM CEST 

  -->

Extract from my pom.xml :

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>2.4</version>
    <dependencies>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics-annotate</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jaxb2-commons</groupId>
            <artifactId>jaxb-fluent-api</artifactId>
            <version>2.1.8</version>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.xml</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics</artifactId>
            <version>0.12.0</version>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.xml</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-xjc</artifactId>
            <version>2.3.0.1</version>
        </dependency>
    </dependencies>
    <configuration>
        <extension>true</extension>
        <arguments>
            <argument>-Xannotate</argument>
            <argument>-Xfluent-api</argument>
            <argument>-Xequals</argument>
            <argument>-XtoString</argument>
            <argument>-Xcopyable</argument>
        </arguments>
        <clearOutputDir>true</clearOutputDir>
        <packageName>xxxxxxxxxx</packageName>
        <encoding>UTF-8</encoding> 
        <sources>
            <source>${basedir}/src/main/resources/xsd</source>
        </sources>
        <xjbSources>
            <xjbSource>${basedir}/src/main/resources/xjb</xjbSource>
        </xjbSources>
        <!-- Needed with JAXP 1.5 -->
            <vmArgs>
                <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
            </vmArgs>
            <noGeneratedHeaderComments>true</noGeneratedHeaderComments>
        <locale>en</locale>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>xjc</goal>
            </goals>
        </execution>
    </executions>
</plugin>
lennartj commented 5 years ago

This pertains to another Maven plugin. Please refer to the Highsource one for this question.