Tomcat 10.x onwards uses Jakarta EE, which is not backwards compatible with J2EE / Java EE. To ease migration, a Jakarta EE migration tool is part of Tomcat, and through the |
Codehaus Cargo 1.10.14 introduced a functionality to benefit for the same, by providing a property called version
on Deployable objects, to specify whether it is j2ee
, javaee
or jakartaee
and enable the Tomcat deployer to handle it accordingly:
j2ee
and javaee
WARs are deployed into the legacyAppBase
folder, steered through the property value for TomcatPropertySet.WEBAPPS_LEGACY_DIRECTORY
appBase
folder, steered through the property value for TomcatPropertySet.WEBAPPS_DIRECTORY
LocalContainer container = new Tomcat10xInstalledLocalContainer( new Toncat10xStandaloneConfiguration("target/tomcat10x")); container.setHome("c:/tomcat/tomcat-10.1.23"); Deployable war = new WAR("src/data/some.war"); war.setVersion(DeployableVersion.JAVA_EE); container.getConfiguration().addDeployable(war); container.start(); |
<cargo containerId="tomcat10x" home="c:/tomcat/tomcat-10.1.23" action="start"> <configuration> <deployable type="war" file="path/to/some-war.war"> <property name="version" value="javaee"/> </deployable> </configuration> </cargo> |
<dependencies> <dependency> <groupId>org.codehaus.cargo</groupId> <artifactId>simple-war</artifactId> <version>${simple-war.version}</version> <type>war</type> </dependency> </dependencies> <plugins> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven3-plugin</artifactId> <version>${cargo.version}</version> <configuration> <container> <containerId>tomcat10x</containerId> <artifactInstaller> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat</artifactId> <version>10.1.23</version> </artifactInstaller> </container> <deployables> <deployable> <groupId>org.codehaus.cargo</groupId> <artifactId>simple-war</artifactId> <type>war</type> <properties> <version>javaee</version> </properties> </deployable> </deployables> </configuration> </plugin> </plugins> |