Open bhathiya opened 7 years ago
Maven plugin configuration is additive when you activate multiple profiles simultaneously.
So d-m-p will try to start all defined images in every start
execution.
To avoid that, just try including a suitable <filter>
tag in each execution configuration, to explicitly list the images to be started or stopped.
Does docker-maven-plugin
support filtering? Could you please give me a sample?
<execution>
<id>default-start</id>
<goals>
<goal>start</goal>
</goals>
<configuration>
<filter>mysql</filter>
</configuration>
</execution>
I read about it here, but couldn't find a complete example anywhere. I tried many different things, but none of them worked.
In this case, how can I specify my image list? Appreciate some guidance.
@bhathiya did you make any progress on running multiple profiles (2 years ago) ?
Nope. Configured Jenkins to run each profile separately.
Forgot this. I created a single profile to wrap others. See https://github.com/wso2/carbon-apimgt/blob/master/components/apimgt/org.wso2.carbon.apimgt.core/pom.xml#L316
thanks @bhathiya for sharing. mine was a bit simpler, so I gave up and run all images. And disable/enable tests that use that additional image. The image that I wanted to add with certain profile was a small one. If I need more then I will certainly use your solution. Thanks again.
In my maven project, I have multiple maven profiles. In each profile, I have
docker-maven-plugin
andmaven-failsafe-plugin
. I have profiles for each database type (i.e. MySQL, Postgres etc.). What I'm trying to do is that run my integration tests on docker for each database type.However, when I run this command,
mvn clean install -P local-mysql,local-postgres
it fails with below error.
If you look clearly, it starts Postgres container at
start-docker-for-MySQL
execution, which is wrong. And it fails when it tries to start Postgres container again instart-docker-for-Postgres
execution which makes sense, due to the previous issue.I believe this is a bug. If not, please let me know what I'm doing wrong.
mvn -v
) : 3.3.9