我怎么知道docker-maven-plugin
在运行集成测试之前等待 RabbitMQ 容器完全启动?
这是我在中使用的插件配置pom.xml
:
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<executions>
<execution>
<id>start-rabbitmq-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<images>
<image>
<alias>rabbitmq</alias>
<name>rabbitmq:3.6.10-management</name>
<run>
<log>
<prefix>RABBITMQ</prefix>
<color>cyan</color>
</log>
<namingStrategy>alias</namingStrategy>
<ports>
<port>5672:5672</port>
<port>15672:15672</port>
</ports>
</run>
</image>
</images>
</configuration>
</execution>
<execution>
<id>stop-rabbitmq-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
目前 IT 开始执行,而 RabbitMQ 它仍在初始化并且由于服务器不可用而失败。