The ContainerStopMojo cannot resolve dependencies with scope <test> whereas ContainerRunMojo and ContainerStartMojo can


Based on user complaint:

We're using maven 2.2.1 with cargo on REST client & server Java packages, let's call it foo (all the pom goodness will be below). It's got separate foo-client and foo-server projects, and the client's integration test starts up an instance of the foo-server. When using version 1.1.3 of cargo, this works fine, but on 1.1.4 I get the following error when running the cargo:stop goal:
Artifact [com.opower:foo-server:war] is not a dependency of the project.

Can anybody help point me at the cause and a decent solution to this issue? I've found two workarounds for this issue, neither of which feels like an ideal solution:
1. adding a "<version>1.1.3</version>" specifier to cargo's <plugin> block causes the build to work fine
2. removing the cargo:stop goal and letting maven forcefully shut it down also works

I'm a bit of a maven n00b and I hope that I've included enough information to be helpful without writing a novel... if you scroll you'll see the foo-client pom, the maven output (v1.1.4), the maven output using version 1.1.3 with no failure, and finally the foo-server pom.


The project is set up with a parent pom.xml and the following child projects:

foo-client's pom.xml:

Console output from running a build:

By specifying the 1.1.3 version of the cargo plugin, the same build cycle succeeds as shown here:

And as a final postscript, the foo-server POM:


Savas Ali Tokmen


Savas Ali Tokmen


Fix versions

Affects versions