ZUGFeRD / mustangproject

Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
http://www.mustangproject.org
Apache License 2.0
168 stars 99 forks source link

Jakarta Support #372

Closed paulsen-it closed 2 days ago

paulsen-it commented 2 months ago

Please implement a Jakarta Version from MustangProject

jstaerk commented 2 months ago

Whats the advantage? And what would you need to implement it?

paulsen-it commented 2 months ago

We use Spring Boot and in the latest version Spring Boot has been changed to Jakarta. As a result, I have problems integrating the Mustang Project. Because a mixture of Javax and Jakarta causes complications.

Sarenor commented 1 month ago

@paulsen-it if you're just running the mustang library without the validator I didn't need to do much to make it compatible. If you need to run the validator as well you can override a lot of the mustang dependencies with their Jakarta equivalent to make it work (excuse the gradle format):

  // Mustang Dependencies
  implementation group: 'xerces', name: 'xercesImpl', version: xercesVersion
  implementation 'org.xmlunit:xmlunit-assertj:2.8.2'
  implementation group: 'org.mustangproject', name: 'validator', version: mustangVersion
  // Dependencies necessary to run the mustang validator in SB 3+ & Java 11+
  implementation group: 'org.verapdf', name: 'core-jakarta', version: '1.24.2'
  implementation group: 'org.verapdf', name: 'parser', version: '1.24.1'
  implementation group: 'org.verapdf', name: 'feature-reporting', version: '1.24.2'
  implementation group: 'org.verapdf', name: 'validation-model', version: '1.24.2'
  implementation group: 'org.verapdf', name: 'metadata-fixer', version: '1.24.2'
  implementation group: 'com.helger.schematron', name: 'ph-schematron-xslt', version: '8.0.0'
  implementation group: 'com.helger.schematron', name: 'ph-schematron-api', version: '8.0.0'
  implementation group: 'com.helger.commons', name: 'ph-jaxb', version: '11.1.6'
phax commented 2 weeks ago

The benefit is, that you get maintained artifacts. After moving "JavaEE" to the Eclipse Foundation, they were forced to change the namespaces from javax.* to jakarta.*. So using javax.* is like riding a dead horse - it has no future. However, the switch to Jakarta requires to update to JAXB 4, minimum Java 11 etc. As an author of some of these dependencies, I am not convinced the simple replacement is a suitable long term solution....

Sarenor commented 2 weeks ago

I completely agree with that but there isn't much choice when you have to make it work now, sadly.

phax commented 2 weeks ago

I created a fork and the changes are more then just dependency updates. Working on the tests and will create a PR when ready

phax commented 2 weeks ago

Initial proposal in #393 - depends also on #373