Skip to content

Upgrade to NeTEx 2.0 - #362

Open
vpaturet wants to merge 3 commits into
mainfrom
upgrade_netex_2_0
Open

vpaturet wants to merge 3 commits into
mainfrom
upgrade_netex_2_0

Conversation

@vpaturet

@vpaturet vpaturet commented Apr 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Upgrade to NeTEx 2.0 via org.entur:netex2-java-model 3.0.0 (entur/netex-java-model#270) and netex-parser-java 5.0.0 (entur/netex-parser-java#328). The validator version becomes 13.0.0.

Changes

  • Depend on org.entur:netex2-java-model 3.0.0-SNAPSHOT (new artifact) and netex-parser-java 5.0.0-SNAPSHOT, resolved from the Sonatype snapshot repository.
  • Move all imports from org.rutebanken.netex.* to org.entur.netex2.*.
  • Java baseline raised to 21, matching the model.
  • Adapt to the NeTEx 2.0 model API: AllVehicleModesOfTransportEnumeration → AllPublicTransportModesEnumeration, MultilingualString mixed content (new MultilingualStringValue helper), null-safe DatedServiceJourney.getReplacedJourneys().
  • NeTExValidator constructors are private in 3.0: use NeTExValidator.getNeTExValidator(version).
  • Documents declaring NeTEx version 2.0 are validated against the 2.0 schema (NetexVersion.v2_0).
  • CI: temporarily build on push to upgrade_netex_2_0 and publish snapshots from that branch.

Before merging

  • Remove the upgrade_netex_2_0 triggers and the publish-snapshot job from push.yml.
  • Switch to released versions of netex2-java-model and netex-parser-java and drop the snapshot repository from the pom.

Not changed

  • NetexDataRepository.serviceJourneyIdToActiveDates still returns List<LocalDateTime> although OperatingDay.calendarDate is now a LocalDate in the model. Consumers must convert; this could be changed to LocalDate in a follow-up.

Testing

mvn test with Java 21: 272 tests, 0 failures.

@vpaturet
vpaturet force-pushed the upgrade_netex_2_0 branch from e53e86c to 4b5972d Compare April 10, 2026 13:33
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
60.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@vpaturet vpaturet changed the title Upgrade to netex-java-model 3.0.0-SNAPSHOT and netex-parser-java 5.0.… Upgrade to NeTEx 2.0 Apr 10, 2026
- Depend on org.entur:netex2-java-model instead of netex-java-model
- Move imports from org.rutebanken.netex.* to org.entur.netex2.*
- Use NeTExValidator.getNeTExValidator(version); constructors are private
- Detect NeTEx 2.0 documents and validate them against the 2.0 schema
- Java 21 baseline in CLAUDE.md
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant