Cargo or tomcat plugin to do functional test with Geb and Spock

Hi I’d like to automate in our CI the functional testing of our web app. So I need to deploy 2 wars with some config files in a tomcat container. The cargo plugin and the tomcat-plugin seems to be 2 valid candidate to do the job and I started to test cargo, but as both plugin are very active, and seems to overlap, I’d like to know if you have any recommendations?

Thanks

Nicolas

The answer to your question kind of depends on how you are planning to exercise your tests. Are you assuming that the container is already installed in the environment or are you planning to instantiate the container with the help of the Gradle build?

At the moment the Tomcat plugin only supports deploying a single WAR file. It’s main purpose is to use it for development as an easy and quick way to deploy, run and test an application. The Cargo plugin allows for deploying multiple archives. It doesn’t provide an embedded implementation fro Tomcat. Generally, it should be possible to use both plugins.

Thanks for your answer Benjamin I planned to support multiple testing scenarios. During development, developer can test directly on their own installation, but in the CI, it is nice to have everything deployed automatically.

I was not aware that the tomcat plugin could only deploy 1 war. This is good to know, as I spent some time today experimenting cargo. I used the zip installer, to get a tomcat 7.0.52 automatically. An so far this work very well. I have a bunch of integration test working. The only real issue I got was to provide external config file in the classpath of the webapp. I tried multiple combination to add an extra directory in the shared classpath of tomcat. In the end, I packaged the conf files in a jar and added the jar only in the shared classpath. Everything works and is elegant.

Gradle is so much pleasant to use than Maven And thanks for your plugins, cargo usage is great.

I was just wondering if the tomcat plugin would not have been better.

Thanks again