1

There are multiple source xsd defined for code generation and it seems to be a length restriction for source paths. If I remove the comments to add the source tag the code generation complains about too much enum constants and fails. For solving this I added typesafeEnumMaxMembers="2000" to binding.xjb before. It's like binding settings are ignored when several sources are specified or the path gets to long. Code generation with lesser source tags works as expected.

Any suggestions?

snippet:

<configuration>
          <xjbSources>
            <xjbSource>src/main/xjb/binding.xjb</xjbSource>
          </xjbSources>
          <sources>
            <source>src/main/resources/xsd/Bausparmodellrechner/2017/2/berechneTAModell/Anfrage.xsd</source>
            <source>src/main/resources/xsd/Bausparmodellrechner/2017/2/berechneTAModell/Antwort.xsd</source>
            <source>src/main/resources/xsd/Bausparmodellrechner/2017/2/druckeTAModell/Anfrage.xsd</source>
            <source>src/main/resources/xsd/Bausparmodellrechner/2017/2/druckeTAModell/Antwort.xsd</source>
            <source>src/main/resources/xsd/is-konditionen/1.0/GibDarlehenskonditionenAntwort.xsd</source>
            <source>src/main/resources/xsd/sv/sv.xsd</source>
            <source>src/main/resources/xsd/Bausparantrag/2017/1/pruefeAntrag/Anfrage.xsd</source>
            <source>src/main/resources/xsd/Bausparantrag/2017/1/pruefeAntrag/Antwort.xsd</source>
<!--             <source>src/main/resources/xsd/Bausparantrag/2017/1/druckeAntrag/Anfrage.xsd</source> -->
            <source>src/main/resources/xsd/Bausparantrag/2017/1/verarbeiteAntrag/Anfrage.xsd</source>
<!--             <source>src/main/resources/xsd/Bausparantrag/2017/1/verarbeiteAntrag/Antwort.xsd</source> -->
          </sources>
        </configuration>

binding.xjb:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jxb:bindings version="2.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    jxb:extensionBindingPrefixes="xjc">

    <!-- Raise theEnumMemberSizeCap limit -->
    <jxb:globalBindings typesafeEnumMaxMembers="2000">
    </jxb:globalBindings>

</jxb:bindings>
lexicore
  • 42,748
  • 17
  • 132
  • 221
Marc Stroebel
  • 2,295
  • 1
  • 12
  • 21

1 Answers1

1

Found a workaround using inline bindings in xsd file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema ... xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="2.0">
  <xsd:annotation>
    <xsd:appinfo>
      <jxb:globalBindings typesafeEnumMaxMembers="2000" />
    </xsd:appinfo>
  </xsd:annotation>
....
</xsd:schema>

Another option is moving the entire project from

/Users/myuser/Documents/build/myproject

to a shorter base path like

/Users/myuser/myproject
Marc Stroebel
  • 2,295
  • 1
  • 12
  • 21