mvn clean package says:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/christopher.valmas/dev/WIL-70234/slip-status-consumer/src/main/java/com/openbet/willhill/slip_status_consumer/config/SlipStatusConsumerConfig.java:[29,46] cannot access org.springframework.context.annotation.Bean
bad class file: /home/christopher.valmas/.m2/repository/org/springframework/spring-context/6.0.0/spring-context-6.0.0.jar(org/springframework/context/annotation/Bean.class)
class file has wrong version 61.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
My code has "import org.springframework.context.annotation.Bean;"
Using Spring boot version 2.7.5
Comment From: bclozel
Spring Framework 6.0 brings a baseline change, including a Java 17 requirement.
Please note that you cannot use Spring Framework 6.0 with Spring Boot 2.7.x as they are incompatible. You'll need to use Spring Boot 3.0 which will be released later this week. For further questions, please use StackOverflow.