简体   繁体   中英

IntelliJ running wrong version of SpringBoot - mvn and java jar work correctly

I am running version 2018.1.2 of IntelliJ. Whenever I run or debug my application from within IntelliJ, Springboot is running version 2.0.0.RELEASE (and erroring out). The pom.xml has the following set:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.1.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

When I run mvn clean package , I can see that it is running version 2.0.1.RELEASE and everything works as expected. I have also tried running java -jar app.jar and it is showing 2.0.1.RELEASE.

I have looked all over IntelliJ to see if there are any additional settings or places to override the version and I have found nothing. Does anyone know how to ensure the version of Springboot within IntelliJ?

I'm not sure what the actual fix is, but I can provide the steps that resolved the issue:

  • Backed up and deleted .idea folder and .iml file from project
  • Reimported, build (errored immediately)
  • Restored .idea folder, but deleted contents of library folder
  • Reimported, mvn clean package, build (failed immediately)
  • Restored library items
  • Build (failed immediately)
  • Mvn clean package, reimport, build (success)

None of the files or steps really changed, but this process somehow fixed things.

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