Some performance work shows that a simple Spring Data JPA application can have improved startup time if the following exclusions are applied to spring-boot-starter-data-jpa.
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</exclusion>
<exclusion>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</exclusion>
</exclusions>
My non scientific testing shows before:
2024-10-29T21:09:51.630-07:00 INFO 18539 --- [demo] [ main] com.example.demo.DemoApplication : Started DemoApplication in 2.056 seconds (process running for 2.228)
after:
2024-10-29T21:10:57.554-07:00 INFO 18544 --- [demo] [ main] com.example.demo.DemoApplication : Started DemoApplication in 1.774 seconds (process running for 1.943)
Perhaps we should change existing starters that pull in spring-boot-starter-aop to instead just pull in spring-aop.
Comment From: philwebb
The dependency to the aot starter was added in commit d06d202fd095d07ff48a8f7e8c68cd7477f56490. I think we can safely drop it. Users can add it back again if it causes problems.
Comment From: philwebb
Commit 765bfbd08689a36b8ef9fcbaba1091d029bce113 might also be relevant. It looks like spring-aspects was added for the auditing feature.
Comment From: philwebb
Spring Data does give a nice error message so I'm still tempted to remove the dependency.