I have a spring-boot project where all integration tests are in a separate module that launches the application module using spring-boot-maven-plugin
during the integration-test
phase and runs the package against it. This construct worked fine until it was upgraded to 1.4.0.RELEASE. Now I get a ClassNotFoundException
.
After I checked the structure "1.4.0", I realized that its difference from "1.3.6" is one and all the packages are no longer at the top level, but in the BOOT-INF and other folders (see screenshots below) , and the classloader can no longer find the package defined in "mainClass".
Does anyone have any ideas for fixing it and if this solution is possible in the new version?
Thanks in advance!
jar structure <1.4.0
jar structure> = 1.4.0
ITest module:
<!-- dependency to the app module --> <dependency> <groupId>com.company.app</groupId> <artifactId>app-module</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> ... <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${spring.boot.version}</version> <configuration> <mainClass>com.company.app.RunServer</mainClass> </configuration> <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>
Application module:
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin>
source share