I know how to find version of JDK I am using. I can issue java -version
in command line and it will print me the version.
I know how to find version of Eclipse I am using. I can go to
Eclipse menu > Help > About Eclipse and it will show me the version
of Eclipse.
I know what version of JUnit I am using. I can open my pom.xml file
of my root project and look for <junit.version>
stanza.
I also know what WAS Liberty server I am using. I can go to Eclipse Servers, right click on my server, Properties, Product Info and it tels me I use version 21.0.0.4 of WebSphere Application Server.
However, it is unclear to me how do I find what version of JavaEE and/or JakartaEE is my application using.
How do I find version of JavaEE or JakartaEE Platform my app is using? I am using Maven and I dont see anything like "javaee" or "jakartaee" in my pom.xml files.
Usually, if you are developing a JavaEE/JakartEE application using maven or gradle you will have the dependency on the javaEE/jakartaEE dependency in your gradle configuration or your maven pom.xml file.
As I have more experience using maven I will elaborate using a maven example. So basically you will have a dependency looking like this:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
Using maven you will need this, so it knows that it needs the dependency in order to resolve java-ee features. For example @Inject Annotations, as well as CDI annotations and capabilities.
However, as the application server you are developing for, already has those jars packed with it, you dont want the default (=compile) scope used for this dependency as this would make your application unneccesarily large and might lead to issues with different classloaders.
Another option that I have seen in various projects is to, instead of adding a dependency to javaee directly is to import the bom (bill of materials) of your application with scope "import" and type "pom" in the dependencyManagement section of your own pom. Usually, this bill of materials has specified the javaee version it supports in there. This makes it easy to use required dependencies in your dependency section and omitting the version in order for your version to be in sync with your application server.
So for example, if you are developing for jboss, your dependency can look like this:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>wildfly-javaee8</artifactId>
<version>17.0.1.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
A closer look at the dependencies defined in the imported bom will then tell you the provided dependencies of your application server.
Further information on bill-of-materials can be found here