I upgraded a spring boot project from v 2.1 to 2.4.0 . After a 'mvn clean install' the configuration processor jar is missing in the app.jar.
Build goes with spring-boot-maven-plugin:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>-Xdebug</jvmArguments>
<finalName>app.jar</finalName>
<skip>false</skip>
</configuration>
</plugin>
I'm using classes from that jar ( JSONObject and JSONException )
And I end up with: java.lang.ClassNotFoundException: org.springframework.boot.configurationprocessor.json.JSONException
No issue running the Main.java class . Only after packaging the jar has this missing dependency.
Comment From: snicoll
I'm using classes from that jar ( JSONObject and JSONException )
This is to be expected I am afraid. The configuration processor is an annotation processor and is only meant to be used by the build (to generate configuration metadata). It's not a module for which you should have a dependency on whatsoever. As of 2.4.0 we remove starters and annotation processors we know about (see #22036). Let's reuse this issue to update this section of the release notes.
Comment From: snicoll
I've updated the release notes.
Comment From: JulienHoullier
Is it possible to use JAVA 9 module-info to exclude thoses classes from being used at compilation time. Since the pb is not showing at compilation or test time, only e2e tests were packagred applications could put it in light.