Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartaee-platform-dev] Dependencies on both javax- and jakarta-versions of Spec APIs

Yes it should work with the javax version


On Wed, Nov 24, 2021 at 7:35 PM Ivar Grimstad <ivar.grimstad@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Since Maven picks the higher version of two dependencies with identical groupId/artifactId, there is an issue for projects that need to reference both the javax- and jakarta-versions of the same API. Jakarta Messaging was put forward as an example.

With the following two dependencies in the pom.xml,

<!-- Jakarta EE 8 version -->
<dependency>
  <groupId>jakarta.jms</groupId>
  <artifactId>jakarta.jms-api</artifactId>
  <version>2.0.1</version>
</dependency>
<!-- Jakarta EE 9 version -->
<dependency>
  <groupId>jakarta.jms</groupId>
  <artifactId>jakarta.jms-api</artifactId>
  <version>3.0.0</version>
</dependency>

Version 3.0.0 will win, and only the jakarta-namespace version can be used in the code.

We discussed the possibility of re-releasing the "Jakarta EE 8 version", the one on the javax-namespace under new groupId/artifactId combination, or with a classifier that makes it unique.

After the call, I came to think of another solution to avoid the entire re-release.
Since the Java EE 8 and Jakarta EE 8 versions are identical, wouldn't it also be possible to go around this problem by using the Java EE 8 versions of the javax- version of the dependency?

Like this:

<!-- Java EE 8 version -->
<dependency>
  <groupId>javax.jms</groupId>
  <artifactId>javax.jms-api</artifactId>
  <version>2.0.1</version>
</dependency>
<!-- Jakarta EE 9 version -->
<dependency>
  <groupId>jakarta.jms</groupId>
  <artifactId>jakarta.jms-api</artifactId>
  <version>3.0.0</version>
</dependency>

Just a thought...

Ivar

--

Ivar Grimstad

Jakarta EE Developer Advocate | Eclipse Foundation Eclipse Foundation - Community. Code. Collaboration. 

_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev

Back to the top