Why spring-boot-gradle-plugin does not provide start and stop tasks to be used for integration tests?

39 Views Asked by At

I am trying to execute some UI tests on the browser (selenium-like tests) within a spring boot project, so I need to have the application up and running before those tests could be executed. The same thing is achieved easily in maven using the spring-boot-maven-plugin:

<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>

However, I couldn't find any obvious alternative for achieving the same in Gradle. The Gradle Application plugin also lacks start/stop tasks. I wonder whether that's by design or not, and if so, what is the recommended alternative?

Clearly, I can write some tasks of my own to make it work (see this answer), but I'm more curious why there isn't an officially supported solution. Although, there is always a chance that I'm missing something obvious ;)

0

There are 0 best solutions below