@codemod/spring-7-api-config-migration
Conservative Spring Framework 7 Java migration codemod for Java source under src/main/java/** and src/test/java/**. It applies deterministic AST-based rewrites for exact-safe Spring 7 baseline upgrades and avoids compatibility rewrites that require symbol resolution or project-specific policy.
What It Rewrites
WebMvcConfigurerAdapter,AsyncConfigurerSupport,SchedulingConfigurerSupport, andWebSocketMessageBrokerConfigurerAdaptersuperclass usage to direct interface implementation.- Redundant single-constructor
@Autowiredannotations. - Spring
@Requiredannotations. - Obsolete
@ConstructorBindingmarkers. javax.validation.*imports tojakarta.validation.*.LocalVariableTableParameterNameDiscoverertoStandardReflectionParameterNameDiscovererfor imported or fully-qualified type references.- Simple
PropertySourcesPlaceholderConfigurerbean methods that only return a new default instance from an annotation-based@Configurationclass. - Exact Spring-version compatibility branches using
SpringVersion.getVersion()and allowlistedClassUtils.isPresent(...)checks whose outcome is dead on a Spring 7 baseline.
Preserve Cases
- User-defined types that only share a Spring adapter simple name.
- Constructors where
@Autowiredis still required because multiple constructors exist. PropertySourcesPlaceholderConfigurerbeans with custom settings or initialization logic.- Optional-library probes unrelated to Spring baseline compatibility.
- Production
SocketUtilsreplacement, field-to-constructor injection, and other policy-sensitive rewrites from the broader spec.
Run
bash
Development
bash
License
MIT