Cargo still deploys autodeployable even if <deployables> is not empty in a WAR project packaging



I have been trying to setup the Cargo Maven Plugin in our project which has the WAR packaging. In that project, we build a standalone microservice using Thorntail, hence the WAR packaging. This microservice is started using java -jar command by another Maven Plugin. The microservice then contacts other application in WildFly, which is downloaded, deployed, started and managed by Cargo.

The issue is that Cargo tries to deploy the microservice on WildFly as well because the project itself is a WAR packaging, but I only want it to deploy just that WildFly application.

I work with one of the contributors, Karel Suta, and we looked first at the documentation of cargo:start which says:

So 2 conditions: no deployables defined AND Java EE packaging.

But as you can see, we have a deployable specified (WildFly app), but it still deploys the project's deployable.

In fact, when we looked at the code here and here and also at the JavaDoc of the addAutoDeployDeployable method, it says:

So the real conditions are:

  • Java EE packaging

  • No deployer specified by the user

  • Auto-deployable not specified in the deployables element

Which we satisfy, so from the code perspective it works.

The issue is that we have to work around it by setting <deployer/>, which will set it basically to non-null and condition in addAutoDeployDeployable method will not be satisfied.

We think that either the documentation on the website should be fixed, or, preferably, we should alter the code so it behaves like the documentation on the website. I think it can be easily fixed by removing

from the addAutoDeployDeployable method. So Cargo won't deploy the project's deployable if the deployables element has already something specified. Of course, if a user wanted to deploy that as well, they can always add such a deployment do deployables.

What do you think?




Marian Macik


Marian Macik


Fix versions

Affects versions