10

I am using the latest stable version of quite standard Java libraries such as Spring, yet getting 'overlapping classes' warning from maven shade plugin about three different libraries that define the same classes.

The libraries: jakarta.activation-api, javax.activation-api, activation.

Specifically:

  1. jakarta.activation:jakarta.activation-api:jar:1.2.2 (dependency of jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3)
  2. javax.activation:javax.activation-api:jar:1.2.0 (dependency of javax.xml.bind:jaxb-api:jar:2.3.1, I think this one should be replaced by jakarta.xml.bind-api, but not sure)
  3. javax.activation:activation:jar:1.1 (dependency of com.sun.mail:javax.mail:jar:1.6.2)

What library is the 'right' one that will cause the least amount of trouble?

Update: it seems that jakarta.xml.bind-api replaces javax.xml.bind:jaxb-api (proof: here and here), so in the conflict between (1) and (2) the jakarta one (jakarta.activation-api) should be preferred over the javax one (javax.activation-api). The preferred JAXB dependencies are described in Jakarta web site. But it is still unclear how is this related to javax.activation:activation.

1 Answer 1

10

Finally got it.
JavaBeans activation framework has been moved to Jakarta Activation, see Jakarta JAF page, it means javax.activation:activation is out of date.
The right one seems to be jakarta activation, thanks to this answer.

Same for emails and XML processing that require the activation JAR - use the Jakarta ones: com.sun.mail:jakarta.mail and jakarta.xml.bind:jakarta.xml.bind-api.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.