samdjstevens / java-totp

A java library for implementing Time-based One Time Passwords for Multi-Factor Authentication.
MIT License
448 stars 109 forks source link

Fixed: Beans declared in TotpAutoConfiguration file are not created with Spring boot 3.2.1. #57

Open vinap opened 9 months ago

vinap commented 9 months ago

Error: Beans declared in TotpAutoConfiguration.javafile are not created after with Spring 3.2.1.its throwing below error image ''

Cause: The spring.factory file is deprecated in spring boot 2.7 and its completely removed in spring 3.2.1.

Fix: added dev.samstevens.totp.spring.autoconfigure.TotpAutoConfiguration entry in file totp-spring-boot-starter/src/main/resources/META-INF/org.springframework.boot.autoconfigure.AutoConfiguration

Reference from spring doc:- https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#auto-configuration-files

Spring Boot 2.7 introduced a new META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports file for registering auto-configurations, while maintaining backwards compatibility with registration in spring.factories. With this release, support for registering auto-configurations in spring.factories using the org.springframework.boot.autoconfigure.EnableAutoConfiguration key has been removed in favor of the imports file. Other entries in spring.factories under other keys are unaffected.

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.7-Release-Notes#auto-configuration-registration

Auto-configuration Registration If you have created your own auto-configurations, you should move the registration from spring.factories under the org.springframework.boot.autoconfigure.EnableAutoConfiguration key to a new file named META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. Rather than a single comma-separate list, each line contains the fully qualified name of an auto-configuration class. See the included auto-configurations for an example. For backwards compatibility, entries in spring.factories will still be honored.

eastack commented 2 months ago

Shouldn't the filename be org.springframework.boot.autoconfigure.AutoConfiguration.imports?

Duncol commented 2 months ago

Is this project still maintained?