我正在开发一个 Spring Boot 应用程序,作为我的 maven 项目的集成测试阶段的一部分,我已将 spring-boot maven 插件配置为在构建的前后集成测试部分期间启动和关闭,如下所示:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
但是,我这样做只是为了让我的开发人员可以针对服务的本地实例运行他们的测试。在 Jenkins 上,我将针对已部署该服务的外部服务运行测试,并且我不需要在 Jenkins 作业中启动 Spring Boot 应用程序。
有没有办法让我通过 mvn 命令行覆盖显式阻止 spring-boot maven 插件启动服务?