Repository navigation
Conversation
The NeTEx GitHub repository moved from NeTEx-CEN/NeTEx to TransmodelEcosystem/NeTEx.
With the model generated from NeTEx 2.0, the 1.16 schema was no longer downloaded, so NetexVersion.v1_16 could not load its schema. The 1.16.1 schema is now downloaded as a legacy validation schema like 1.15 and earlier. A document declaring 1.16 is validated against it: patch releases of the schema are backward compatible and documents only ever declare the minor version.
xsd:date elements (OperatingDay/CalendarDate, DayTypeAssignment/Date, ServiceCalendar/FromDate and ToDate, ...) were previously bound to LocalDateTime at midnight. They are now bound to LocalDate. LocalDateXmlAdapter accepts an optional trailing zone offset when unmarshalling, as permitted by xsd:date, and ignores it. Dates are always marshalled as yyyy-MM-dd and no longer depend on the JVM's default offset. xsd:dateTime elements are still bound to LocalDateTime.
parseDefaulting(OFFSET_SECONDS, <JVM default offset at class load>) had no effect: LocalDateTime.from and LocalTime.from never read the offset, so an offset in the input is ignored whether it is present, absent or defaulted. Parsing and formatting results are unchanged. The adapters now document that behaviour, as LocalDateXmlAdapter already does.
Instances are cached per version and obtained through the static getNeTExValidator methods, which the constructor Javadoc already asked callers to use. PublicationDeliveryClient now uses the cached validator.
The style is only meant to be used through INSTANCE. This also removes the javac this-escape warning about the overridable setters called from the constructor.
The generated code references nothing under org.apache.cxf: the toString plugin uses OmitNullsToStringStyle from this library. The runtime-scoped jar was only leaked to consumers.
Releases and snapshots are published by JReleaser through the GitHub workflows. The jfrog snapshot repository, the wagon-ssh-external extension, the maven-release-plugin configuration, the sign and release profiles (GPG signing and the decommissioned oss.sonatype.org staging) and the unused nexus-staging, gpg, release and dependency plugin version properties are left over from the previous release process.
The build only removes the schema folders it is about to download again, so folders from earlier builds (1.16) ended up in locally built jars.
maven-release-plugin, buildnumber-maven-plugin and maven-shade-plugin are not used, so their backup and output files never appear.
… Java 8 deploy.yml can be triggered manually (workflow_dispatch). The manual release workflow still set up Java 11, while every other 1.x workflow builds and publishes with Java 8.
State the NeTEx 2.0 schema and its source, the legacy validation range, the LocalDate mapping, the Java 8 / Java EE 8 baseline and the GML and SIRI packages. The README gains the usage, build and structure sections of the master README, with the 1.x coordinates.
CXF XJC 4.x generates Jakarta XML Binding code and JUnit 6 requires Java 17; the 1.x line targets Java 8 and Java EE 8.
NeTEx 2.0 names its abstract substitution-group heads with a _Dummy suffix (DayType_Dummy is the head of DayType), where 1.x used a trailing underscore. xjc leaked the suffix into the generated API as getDayType_Dummy(), getDayTypeRefOrDayType_Dummy(), createDayType_Dummy() and classes such as MediumAccessDevice_Dummy. Add bin/generate-dummy-bindings.py, which derives one JAXB binding per leak from the schema and writes them into a marked block of bindings.xjb: properties drop the suffix (getDayType(), getDayTypeRefOrDayType()), while factory methods and the few classes generated for heads keep a trailing underscore as in netex-java-model 1.0.x (createDayType_(), MediumAccessDevice_), since dropping it there collides with the factory method of the concrete element. The hand-written TariffZone binding is covered by the generated block. Tests and docs are updated accordingly.
vpaturet
added a commit
to entur/chouette
that referenced
this pull request
Oct 15, 2026
The latest 1.1.0-SNAPSHOT (entur/netex-java-model#277, porting #270) hides the _Dummy suffix of the NeTEx 2.0 substitution-group heads, so the collection getters revert to their plain names (getLine(), getDayType(), getNoticeAssignment(), ...).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade the NeTEx schema from version 1.16 to 2.0 on the 1.x line (Java 8, Java EE 8 /
javax.xml.bind), as the Jakarta line does in #270. The Maven coordinates (org.entur:netex-java-model) and theorg.rutebanken.*packages are unchanged; the version becomes1.1.0-SNAPSHOT.The applicable changes of #270 are integrated. Changes that need Java 11+ or Jakarta EE (JPMS module, CXF XJC 4.x / type-safe enums, JUnit 6, Java 21 CI, text blocks) are not ported.
Breaking changes
xs:dateis mapped tojava.time.LocalDateinstead ofLocalDateTimeat midnight, e.g.OperatingDay.calendarDate,DayTypeAssignment.date,ServiceCalendar.fromDate/toDate.xs:dateTimeis stillLocalDateTime. The adapter accepts and ignores an optional time zone offset on input (2026-05-03+02:00,2026-05-03Z), always writesyyyy-MM-dd, and no longer depends on the JVM's default offset.NeTExValidatorcan no longer be constructed directly. Both constructors are private; useNeTExValidator.getNeTExValidator()orgetNeTExValidator(NetexVersion), which cache one validator per version.NetexVersion.v2_0is added and isLATEST.OmitNullsToStringStyleisfinalwith a private constructor; useOmitNullsToStringStyle.INSTANCE.cxf-xjc-runtimetransitive dependency is gone. The generated code never referenced it. The remaining runtime dependencies arejakarta.xml.bind-api2.3,jaxb-java-time-adapters,jaxb-runtime,slf4j-apiandcommons-lang3.Changes
NeTEx 2.0 schema
TransmodelEcosystem/NeTExrepository (tagv2.0, previouslyentur/NeTExmaster).NetexVersion.v1_16validates against it (patch releases are backward compatible and documents only declare the minor version). Without this,v1_16had no schema to load once the model moved to 2.0.JAXB bindings (
bindings.xjb)xs:date→java.time.LocalDatevia a rewrittenLocalDateXmlAdapter(breaking change 2)_Dummysuffix of the NeTEx 2.0 substitution-group heads is hidden. NeTEx 2.0 names its abstract headsDayType_Dummywhere 1.16 usedDayType_, and xjc leaked that intogetDayType_Dummy(),createDayType_Dummy()and classes such asMediumAccessDevice_Dummy. A generated block inbindings.xjb(frombin/generate-dummy-bindings.py, to be rerun after a schema upgrade) renames them: containers exposegetDayType()/getDayTypeRefOrDayType(),ObjectFactoryexposescreateDayType_(...)and the few classes generated for heads keep a trailing underscore (MediumAccessDevice_), as in 1.0.x. The block is identical to the one in Upgrade to NeTEx 2.0 schema #270.HeadwayJourneyGroupGroup/Descriptionbinding (element removed in 2.0)bookingArrangementsvsBookingArrangementsAdapters
LocalDateTimeISO8601XmlAdapterandLocalTimeISO8601XmlAdapter: theparseDefaulting(OFFSET_SECONDS, <JVM default offset>)had no effect and is removed; an offset in the input was and is ignored. Results are unchanged.Test updates
MultilingualStringnow uses mixed content (withContent()/getContent()instead ofwithValue()/getValue()); helpergetStringValue(MultilingualString)getLine_()→getLine()); factory methods keep it (createLine_())StopPlacesInFrame_RelStructurereturnsList<StopPlace>directly instead of wrappedJAXBElementsAllVehicleModesOfTransportEnumeration→AllPublicTransportModesEnumerationPublicCodeandPrivateCodeare structure types withgetValue()DatedCalltests replaced withAvailabilityConditiontestsLocalDateXmlAdapterTest;UnmarshalServiceCalendarFrameTestassertsLocalDate;NeTExValidatorTestcoversLATEST, the 1.16 → 1.16.1 mapping and the 1.16.1-onlyAssociatedContractelementOther
deploy.yml: can be triggered manually (workflow_dispatch). Temporarily builds on push/PR toupgrade-netex-2.0_for_1.xand publishes snapshots from that branch, so that1.1.0-SNAPSHOTis available before the merge.wagon-ssh-externalextension, themaven-release-pluginconfiguration, thesignandreleaseprofiles (GPG signing and the decommissionedoss.sonatype.orgstaging) and unused plugin version properties..gitignoreentries for unused plugins dropped.mvn cleannow deletessrc/main/resources/xsd, so stale schema folders from earlier builds (1.16) no longer end up in locally built jars.README.mdandCLAUDE.mdupdated for NeTEx 2.0 and the 1.x baseline.Not integrated from #270
netex2-java-model/org.entur.netex2(kept as is for now)module-info.java, Java 21 baseline, JUnit 6, CXF XJC 4.2 (type-safeWeekOfMonthEnumeration/CurrentTypeEnumeration), Sonar test cleanups relying on Java 15+ syntaxBefore merging
1.xtriggers and therefs/heads/1.xsnapshot condition indeploy.yml.Testing
mvn clean installwith Java 8 passes: 28 tests, 0 failures. The built jar bundles the 1.04beta - 1.15, 1.16.1 and 2.0 schemas.