I have the following directory structure:
src
|
|___ main
|
|___ test
|
|___resources
I want to include all the files from test resources in the classpath when running the start goal (spring-boot:start, different than spring-boot:run) in phase pre-integration-test.
My pom.xml is:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
<configuration>
<wait>1000</wait>
<maxAttempts>30</maxAttempts>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
I tried without success including flags addResources
or useTestClasspath
, I really can't figure out how they are supposed to work even reading the documentation (https://docs.spring.io/spring-boot/docs/current/maven-plugin/start-mojo.html).
Thanks in advance.