简体   繁体   中英

Updating my spring version prevents gradle resolving spring-boot-starter

I have a spring-boot project. I'm getting the following issue when I try and start the application.

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@78b1cc93: startup date [Mon Nov 06 13:01:13 UTC 2017]; root of context hierarchy

In my research I have found a bug report that sounds exactly like my issue.

https://jira.spring.io/browse/SPR-16149

The issue seems to be some sort of lower level exception that is not getting handled correctly. Form the looks of things it's an exception that should not be seen in user space. There is a fix for it too. Great! I did some more research on the fix and it turns out you can upgrade your spring version independently of sprig boot. I have applied the following to my build.gradle

ext['spring.version'] = '4.3.13.RELEASE'

However when I try and boot the application with this new version I get the following.

gradle@2eb4803b9c11:/app$ gradle bootRun

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter:.
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter//spring-boot-starter-.pom
      https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter//spring-boot-starter-.jar
      https://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter//spring-boot-starter-.pom
      https://repo.spring.io/libs-milestone/org/springframework/boot/spring-boot-starter//spring-boot-starter-.jar
  Required by:
      project :
> Could not find org.springframework.boot:spring-boot-starter-web:.
  Required by:
      project :
> Could not find org.springframework.boot:spring-boot-starter-data-jpa:.
  Required by:
      project :
> Could not find org.springframework.cloud:spring-cloud-starter-stream-rabbit:.
  Required by:
      project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
1 actionable task: 1 executed

It seems that my project can no longer resolve spring-boot-starter. Am I reading that correctly? Why can't I update my version of spring and use the existing version of spring boot? How are they related?

There is no 4.3.13.RELEASE version available in maven central repository. Latest version of spring is 5.0.1.RELEASE .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM