Friday, 22 May 2020

From JavaEE 8 to JakartaEE 8

So, trying to transition my little hobby project from Java EE to Jakarta EE.

It seems to be going well, mostly because the only thing that has changed are the names of the Maven dependencies1. (for now)

So for now the only changes take place in the pom.xml files.

Here are the changes:

<dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-api</artifactId>
  <version>${javaee.version}</version>
  <scope>provided</scope>
</dependency>
<dependency>
  <groupId>jakarta.platform</groupId>
  <artifactId>jakarta.jakartaee-api</artifactId>
  <version>${jakartaee.version}</version>
  <scope>provided</scope>
</dependency>

I did notice that I could remove one Java EE spec in one of my Maven modules. The servlet-spec. Perhaps because I am using something special in there that's included in the default by now?

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>4.0.1</version>
  <scope>provided</scope>
</dependency>

Superfluous stuff

Noticed some stuff I no longer need. Probable leftovers from early days.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.6</version>
    <executions>
        <execution>
            <phase>validate</phase>
            <goals>
                <goal>copy</goal>
            </goals>
            <configuration>
                <outputDirectory>${endorsed.dir}</outputDirectory>
                <silent>true</silent>
                <artifactItems>
                    <artifactItem>
                        <groupId>javax</groupId>
                        <artifactId>javaee-endorsed-api</artifactId>
                        <version>7.0</version>
                        <type>jar</type>
                    </artifactItem>
                </artifactItems>
            </configuration>
        </execution>
    </executions>
</plugin>

Versions

So my versions have changed as follows:

The old:

<javaee.version>8.0.1</javaee.version>

The new:

<jakartaee.version>8.0.0</jakartaee.version>

That seems to be all.

References

[1] Java Magazine - Transition from Java EE to Jakarta EE
https://blogs.oracle.com/javamagazine/transition-from-java-ee-to-jakarta-ee
Rieckpil - Bootstrap your first Jakarta EE 8 application
https://rieckpil.de/howto-bootstrap-your-first-jakarta-ee-8-application/
Jakarta EE - Jakarta EE Compatible Products
https://jakarta.ee/compatibility/

No comments:

Post a Comment