Search code examples
javaweldjboss-weld

Why weld depends on JBoss Common Annotations 1.3 API instead of using Javax Annotation API?


I'm integrating Weld 3.1.0 into my application. My application already has a dependency with the Javax Annotation API library.

I've noticed that the Weld Implementation (Core) defines a dependency with JBoss Common Annotations 1.3 API library which defines the same java package with (almost) the same classes defined in Javax Annotation API.

Does anyone know why Weld depends on JBoss Common Annotations 1.3 API library instead of directly using the Javax Annotation API?

Thank you in advance.


Solution

  • Curiosity haunted me, so I went and asked this question on WildFly mailing list where I suspected people will recall the reasons. Weld is a JBoss project, just like WildFly, and as such followed the same line of thoughts.

    Here goes the answer (pasted from the mail, thanks to Tomaz Cerar):

    For the longest time java ee related spec apis ware not officially available in any maven repository.

    Only lately with latest version of Java/Jakarta EE spec apis are starting to appear properly in maven central.

    Another reason is as Petr said, some service loader configs (w)are different and in some cases even some impl classes (w)are added.

    So it's partly historical reasons and partly differences in implementation classes.

    As a side note - from user perspective, you shouldn't notice any difference using JBoss API version as opposed to the other one as on the API side they are indeed identical.