Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4 Release Notes does not indicate that known annotation processors are removed from repackaged jar #24244

Closed
kdejaeger opened this issue Nov 25, 2020 · 3 comments
Assignees
Labels
type: wiki-documentation A documentation update required on the wiki

Comments

@kdejaeger
Copy link

kdejaeger commented Nov 25, 2020

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 25, 2020
@snicoll
Copy link
Member

snicoll commented Nov 25, 2020

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.

@snicoll snicoll added type: wiki-documentation A documentation update required on the wiki and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 25, 2020
@snicoll snicoll changed the title spring-boot-configuration-processor:2.4.0.jar missing 2.4 Release Notes does not indicate that known annotation processors are removed from repackaged jar Nov 25, 2020
@snicoll snicoll self-assigned this Nov 25, 2020
@snicoll
Copy link
Member

snicoll commented Nov 25, 2020

I've updated the release notes.

@snicoll snicoll closed this as completed Nov 25, 2020
patrickotto added a commit to quarano/quarano-application that referenced this issue Apr 5, 2021
…en because class JSONException is missing as part of Story 421-423 as part of the sormas integration.

This seems to happen intenially  during the repackaging; See: spring-projects/spring-boot#24244

Not sure if the exception calss is necessary at all, because it is not clear which method should throw it.
=> Removed the throw-declaration of JSONException
@JulienHoullier
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: wiki-documentation A documentation update required on the wiki
Projects
None yet
Development

No branches or pull requests

4 participants