Impossible to set a custom service locator without scanning the classpath twice

Description

The classpath is always scanned twice when setting a custom ServiceLocator.

  • in the default ServiceLocator constructor (called by the static block initialization)

  • in the Custom ServiceLocator constructor if it extends the default ServiceLocator

Spring Boot is using a custom ServiceLocator (CustomResolverServiceLocator) in LiquibaseServiceLocatorApplicationListener$LiquibasePresent#replaceServiceLocator

In our app those 2 scans account for ~20% of the memory allocated at startup.

Environment

Liquibase with custom ServiceLocator

Activity

Show:

Details

Reporter

Components

Affects versions

Priority

Created June 29, 2018 at 2:28 PM
Updated June 29, 2018 at 2:28 PM