GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add support for Jakarta XML Binding · Issue #2730 · mapstruct/mapstruct

Add support for Jakarta XML Binding #2730

New issue
Copy link
New issue
Copy link
Closed
#2994
Closed
Add support for Jakarta XML Binding#2730
#2994
Copy link
Assignees
ibogdanchikov
Labels
enhancementgood first issue
Milestone
1.5.5

Description

@filiphr
filiphr
opened on Jan 22, 2022
Issue body actions

Currently we have support for different elements from JAXB Binding. With the move of that to Jakarta and the change of the namespace we need to also add the same support for the new packages of Jakarta XML Binding

Reacted by Mark Diskin and Sebastian Peters

Activity

  1. filiphr
    added
    enhancement
    on Jan 22, 2022
  2. filiphr
    added this to the 1.6.0 milestone on Jan 22, 2022
  3. filiphr
    added
    good first issue
    on Jun 6, 2022
  4. ibogdanchikov commented on Jun 16, 2022

    @ibogdanchikov
    ibogdanchikov
    on Jun 16, 2022
    Contributor
    More actions

    Hello. I would like to work on this issue, if I may.

  5. filiphr
    assigned
    ibogdanchikov
    on Jun 16, 2022
  6. filiphr commented on Jun 16, 2022

    @filiphr
    filiphr
    on Jun 16, 2022
    MemberAuthor
    More actions

    That would be great @ibogdanchikov. I've assigned it to you

  7. ibogdanchikov commented on Jul 3, 2022

    @ibogdanchikov
    ibogdanchikov
    on Jul 3, 2022
    Contributor
    More actions

    Hello.

    Yesterday I started working on this issue (sorry for the delay BTW, had to meet some hard deadlines at work) and I ran into a problem with the GemGenerator.

    There are already Gems defined for javax.xml.bind.annotation.XmlElementDecl.class and javax.xml.bind.annotation.XmlElementRef.class like this:

    @GemDefinition(XmlElementDecl.class)
    @GemDefinition(XmlElementRef.class)

    as they are used in the XmlElementDeclSelector that is used to select which method from the [usually] ObjectFactory should be used (otherwise compilation fails with the ambiguous mapping methods found error). So I (naively) assumed that I need to add another two @GemDefinitions to the GemGenerator - jakarta.xml.bind.annotation.XmlElementDecl.class and jakarta.xml.bind.annotation.XmlElementRef.class, so I can create XmlElementDeclSelector for Jakarta and so on. And so I (naively) tried, like this:

    @GemDefinition(javax.xml.bind.annotation.XmlElementDecl.class)
    @GemDefinition(javax.xml.bind.annotation.XmlElementRef.class)
    @GemDefinition(jakarta.xml.bind.annotation.XmlElementDecl.class)
    @GemDefinition(jakarta.xml.bind.annotation.XmlElementRef.class)

    The problem is, is that GemProcessor generates Gems based on a type's simple name, so naturally when I try to define two Gems for two annotations that have the same name, even though they are from different packages, conflict arises, and such attempt ends up in a compilation error. More precisely:

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project mapstruct-processor: Compilation failure: Compilation failure: 
    [ERROR] java.lang.IllegalStateException: javax.annotation.processing.FilerException: Attempt to recreate a file for type org.mapstruct.ap.internal.gem.XmlElementDeclGem
    

    I'm a bit stuck on the implementation due to this issue. So I would like to ask if you could give me some advice or a hint on how I could solve this problem? Maybe I'm approaching the problem or the implementation in the wrong way?

    (Tagging @filiphr, @sjaakd and @Zegveld as currently the most active core team members (as per my understanding).)

    Thank you and please forgive me for bothering you.

  8. filiphr commented on Jul 4, 2022

    @filiphr
    filiphr
    on Jul 4, 2022
    MemberAuthor
    More actions

    Hey @ibogdanchikov,

    Your approach was correct. However, it seems like we have a bug in the Gem Tools. I'll work on that to provide an option to define a name for this. For the time being you can add a JakartaGemGenerator in the org.mapstruct.ap.internal.gem.jakarta package and work with that.

  9. ibogdanchikov
    added 12 commits that reference this issue on Aug 28, 2022

    mapstruct#2730 Unify JAXB dependency definitions in parent pom.xml

    3a3aa7c

    mapstruct#2730 Use javax instead of jakarta for old XML binding

    8076285

    mapstruct#2730 Add support for Jakarta XML Binding

    fddb272

    mapstruct#2730 Add unit tests

    130fb14

    mapstruct#2730 Add integration test

    be5ecf8

    mapstruct#2730 Add integration test

    d2228ee

    mapstruct#2730 Add integration test

    5253006

    mapstruct#2730 Unify JAXB dependency versions in parent pom.xml

    89775ae

    mapstruct#2730 Use javax instead of jakarta for old XML binding

    41489c2

    mapstruct#2730 Add support for Jakarta XML Binding

    6737c42

    mapstruct#2730 Add unit tests

    1efd24b

    mapstruct#2730 Add integration test

    980cae1
  10. filiphr
    closed this as completedin #2994on Sep 2, 2022
  11. filiphr
    added a commit that references this issue on Sep 2, 2022

    #2730 Add support for Jakarta XML Binding

    bbf63ae
  12. filiphr
    modified the milestones: 1.6.0, 1.5.5 on Apr 22, 2023
  13. filiphr commented on Apr 22, 2023

    @filiphr
    filiphr
    on Apr 22, 2023
    MemberAuthor
    More actions

    I'll reopen this to cherry pick it for 1.5.5

    Reacted by Sebastian Peters and Mått Hëñry
  14. filiphr
    reopened this on Apr 22, 2023
  15. filiphr
    added 2 commits that reference this issue on Apr 22, 2023

    mapstruct#2730 Add support for Jakarta XML Binding

    e39a566

    #2730 Add support for Jakarta XML Binding

    922258f
  16. filiphr commented on Apr 22, 2023

    @filiphr
    filiphr
    on Apr 22, 2023
    MemberAuthor
    More actions

    This has been cherry picked

    Reacted by Mått Hëñry, burka and jianglinnana
  17. filiphr
    closed this as completedon Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @ibogdanchikov
    ibogdanchikov

Labels

enhancementgood first issue

Type

No type

Projects

No projects

    Milestone

    • 1.5.5

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.