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

AllOpen KSP workaround doesn't actually work #11415

Open
distinctdan opened this issue Dec 5, 2024 · 1 comment
Open

AllOpen KSP workaround doesn't actually work #11415

distinctdan opened this issue Dec 5, 2024 · 1 comment

Comments

@distinctdan
Copy link

Expected Behavior

The docs say that you can add a system property to workaround ksp not being compatible with allopen. However, this doesn't actually have any effect. This is a major annoyance because it's going to force us to mark all of our controllers and methods as open manually when upgrading from micronaut v3 to v4, or go back to using kapt until the ksp and allopen teams can get their stuff to play nice.

The error:

[ksp] /Users/my.user/git/my-project/src/main/kotlin/com/my/package/FooController.kt:31: Cannot apply AOP advice to final class. Class must be made non-final to support proxying: my.package.FooController

My gradle.properties

systemProp.kotlin.allopen.annotations=io.micronaut.http.annotation.Controller

The docs:

Unfortunately, KSP doesn’t see the changes in the classes made by other compiler plugins, which breaks integration with the allopen plugin. To make the integration work, we have introduced an experimental system property kotlin.allopen.annotations for the annotation processor. The property expects a list of annotations that are open, separated by ,.

Actual Behaviour

Doesn't work

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

4.7.1

@TbirdDuncan
Copy link

You shouldn't have to add the controller to the allopen. Are you using micronaut gradle plugin? Whats the full stacktrace of your error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants