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
Provide a flag to disable SpEL support #25153
Comments
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
Jun 18, 2020
This commit introduces a spring.spel.ignore flag which when set to true avoid initializing SpEL infrastructure. A typical use case is optimizing GraalVM native image footprint. Closes spring-projectsgh-25153
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
Jun 18, 2020
This commit introduces a spring.spel.ignore system property which when set to true avoid initializing SpEL infrastructure. A typical use case is optimizing GraalVM native image footprint. In order to be effective, those classes should be initialized at build time: - org.springframework.context.support.AbstractApplicationContext - org.springframework.core.SpringProperties - org.springframework.context.event.EventListenerMethodProcessor Closes spring-projectsgh-25153
sdeleuze
added a commit
to sdeleuze/spring-framework
that referenced
this issue
Jun 18, 2020
This commit introduces a spring.spel.ignore system property which when set to true avoid initializing SpEL infrastructure. A typical use case is optimizing GraalVM native image footprint for applications not using SpEL. In order to be effective, those classes should be initialized at build time: - org.springframework.context.support.AbstractApplicationContext - org.springframework.core.SpringProperties - org.springframework.context.event.EventListenerMethodProcessor Closes spring-projectsgh-25153
kenny5he
pushed a commit
to kenny5he/spring-framework
that referenced
this issue
Jun 21, 2020
This commit introduces a spring.spel.ignore system property which when set to true avoid initializing SpEL infrastructure. A typical use case is optimizing GraalVM native image footprint for applications not using SpEL. In order to be effective, those classes should be initialized at build time: - org.springframework.context.support.AbstractApplicationContext - org.springframework.core.SpringProperties - org.springframework.context.event.EventListenerMethodProcessor Closes spring-projectsgh-25153
|
If we want to use things like Spring Security's @PreAuth annotation, is it still possible to omit this flag and use SpEL in an application compiled into a native image? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Along to #25151, this issue intend to provide a
spring.spel.ignoreflag to disable SpEL support in a way that prevent it to be compiled intro GraalVM native images.For the record this allows to reduce native image size by 1.4M, RSS memory consumption by 2M and build time by 5.5s with Java 8.
Usage of SpEL support with the flag enabled should trigger a proper exception with a message explaining how to re-enable it.
The work done on spring-graalvm-native substitutions has allows to identify a first set of classes where SpEL support should be removed:
EventExpressionEvaluatorusage fromorg.springframework.context.event.EventListenerMethodProcessorandorg.springframework.context.event.ApplicationListenerMethodAdapterbeanFactory.setBeanExpressionResolver(new StandardBeanExpressionResolver(beanFactory.getBeanClassLoader());fromorg.springframework.context.support.AbstractApplicationContextSuch flag could also be used on Spring Boot side as well if needed.
The text was updated successfully, but these errors were encountered: