...
Code Block | ||||
---|---|---|---|---|
| ||||
mvn clean verify org.codehaus.cargo:cargo-maven3-plugin:run -Dcargo.maven.containerId=tomcat9x |
That command will automatically:
- Download the Maven artifact for the version of Tomcat 9.x that our Continous Integration has validated as working fine
- Instantiate the container
- Create a local configuration with your application
- ... and, run it
To use a specific version of Tomcat 9.x, you simply need to run (in one line):
Code Block | ||||
---|---|---|---|---|
| ||||
mvn clean verify org.codehaus.cargo:cargo-maven3-plugin:run -Dcargo.maven.containerId=tomcat9x -Dcargo.maven.containerUrl=https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat/9.0.45/tomcat-9.0.45.zip |
That This time, the command will automatically download Tomcat 9.0.45 from the specified URL (instead, taking into account any proxy server setting you would have in Maven 3), instantiate the container, create a local configuration with your application and run it. It will also save the downloaded container and will it in the default directory (see the Maven 3 Plugin Reference Guide for details), so it won't get downloaded when you run the same command twice.
Now, if If you now want to run this time on WildFly 20.x with with the HTTP port set to 9000
, run:
Code Block | ||||
---|---|---|---|---|
| ||||
mvn clean verify org.codehaus.cargo:cargo-maven3-plugin:run -Dcargo.maven.containerId=wildfly20x -Dcargo.maven.containerUrl=https://download.jboss.org/wildfly/20.0.1.Final/wildfly-20.0.1.Final.zip -Dcargo.servlet.port=9000 |
As you can see, Codehaus Cargo's main advantage is that the commands and configuration remains the same for any version of any supported container - be it Tomcat, Jetty, JBoss, JOnAS, GlassFish, WebLogic, WildFly, etc.
...