How JAXB regeneration works: Sequential Passes
masterThe project uses a sequential pass strategy to handle complex XSD dependencies and avoid collisions.
Package schemas (5 passes)
Compiles into the same output directory. The order is critical:
consSitNFe(renames specific types)consCad(generates minimalTEndereco)distDFeInt(redefines basic types)resNFe(generatesTResNFe)NFe(LAST): Must be the final pass. It generates the comprehensiveObjectFactoryand the completeTEndereco(including UF, cPais, etc.), overwriting previous versions.
Package schemas_eventos (14 passes)
Each pass handles a specific event group (e.g., cancelamento, epec, manifestacao) using .xjb binding files to rename classes and prevent name collisions between different event types that share identical XSD element names.
Individual Events (Passes 15+)
For specific events (like Tax Reform/Reforma Tributária), the script runs xjc in a temporary package, extracts DetEvento.java, renames it to DetEvento<code_id>.java (e.g., DetEvento110001.java), and moves it to schemas_eventos. This ensures the @XmlRootElement annotation is preserved, which is required for successful runtime marshalling.