mojohaus / jaxb2-maven-plugin

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

Plugin does not apply global.xjb binding files. #61

Closed dbcall2 closed 7 years ago

dbcall2 commented 7 years ago

The following configuration:

`

org.codehaus.mojo
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>2.3</version>
    <executions>
      <execution>
        <goals>
          <goal>xjc</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <sources>
        <source>src/main/xsd</source>
      </sources>
      <xjbSources>
        <xjbSource>src/main/xjb</xjbSource>
      </xjbSources>
      <extension>true</extension>
      <packageName>resmed.hi.machinedata.services.summarydata.transform.ndm</packageName>
    </configuration>
  </plugin>`

Does NOT result in any binding files, global.xjb, for example, to be applied to the output. I'm trying to apply the scheme to the generated code and this does not seem to work through the plugin.

However running this command does: xjc -p resmed.hi.machinedata.services.summarydata.transform.ndm -extension src/main/xsd -b src/main/xjb

dbcall2 commented 7 years ago

This appears to be a problem with XJC itself and not the plugin. The inclusion of the global bindings file is influenced by the path name to the enclosing directory! If you shorten the path name to a specified length, usually a multiple of four characters, then the bindings are applied and the build passes. I'm shocked and dismayed that just by changing the path of the enclosing directory you can alter the build behavior so much. :(