Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么在将Spring Boot starter父项目更新到最新的2.2.5.0版本后,在构建Spring Boot项目时会出现此错误?_Java_Spring_Spring Boot_Maven_Spring Boot Starter Parent - Fatal编程技术网

Java 为什么在将Spring Boot starter父项目更新到最新的2.2.5.0版本后,在构建Spring Boot项目时会出现此错误?

Java 为什么在将Spring Boot starter父项目更新到最新的2.2.5.0版本后,在构建Spring Boot项目时会出现此错误?,java,spring,spring-boot,maven,spring-boot-starter-parent,Java,Spring,Spring Boot,Maven,Spring Boot Starter Parent,我是Spring Boot的新手,在更新Spring Boot starter父项目时遇到了一些问题 因此,一开始我有一个pom.xml文件(它工作正常,我可以构建项目,我没有问题): 我正在获取以下错误消息: [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/developer/git/SOC-dashboard/src/

我是Spring Boot的新手,在更新Spring Boot starter父项目时遇到了一些问题

因此,一开始我有一个pom.xml文件(它工作正常,我可以构建项目,我没有问题):

我正在获取以下错误消息:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[6,44] package org.springframework.boot.web.support does not exist
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[9,34] cannot find symbol
  symbol: class SpringBootServletInitializer
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[15,9] method does not override or implement a method from a supertype
[INFO] 3 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.349 s
[INFO] Finished at: 2020-03-20T05:48:14-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project excel-api: Compilation failure: Compilation failure: 
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[6,44] package org.springframework.boot.web.support does not exist
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[9,34] cannot find symbol
[ERROR]   symbol: class SpringBootServletInitializer
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[15,9] method does not override or implement a method from a supertype
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

这是从1.x到2.x的主要spring版本升级。在这样的主要版本升级过程中,通常会有一些破坏性的更改,例如包重组、删除不推荐的类/方法等。最好参考某种类型的迁移指南来进行此类升级。您可以参考或其他一些博客,如

Spring提供了一个依赖模块,可以将其添加到pom文件中。此模块分析应用程序并提供所需更改的诊断输出

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-properties-migrator</artifactId>
    <scope>runtime</scope>
</dependency>

SpringBootServletInitializer
现在可从
org.springframework.boot.web.servlet.support
软件包获得

这是从1.x到2.x的主要spring版本升级。在这样的主要版本升级过程中,通常会有一些破坏性的更改,例如包重组、删除不推荐的类/方法等。最好参考某种类型的迁移指南来进行此类升级。您可以参考或其他一些博客,如

Spring提供了一个依赖模块,可以将其添加到pom文件中。此模块分析应用程序并提供所需更改的诊断输出

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-properties-migrator</artifactId>
    <scope>runtime</scope>
</dependency>

SpringBootServletInitializer
现在可从
org.springframework.boot.web.servlet.support
软件包获得

您正在升级1个主要版本和2个次要版本,其中包括全面的更改。SpringBoot 1.5.x于去年8月下线。我会;我建议读一下这篇文章,升级到2.0.0,然后再升级到2.1,然后再升级到2.2,@darrenforsyth它解决了我的问题。如果你打开它作为回应,我会很高兴地接受它作为回应,你正在升级1个主要版本,包括全面的更改和另外2个次要版本。SpringBoot 1.5.x于去年8月下线。我会;我建议读一下这篇文章,升级到2.0.0,然后再升级到2.1,然后再升级到2.2,@darrenforsyth它解决了我的问题。如果你打开它作为回应,我会很乐意接受它作为答案
mvn clean install -DskipTests=true
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[6,44] package org.springframework.boot.web.support does not exist
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[9,34] cannot find symbol
  symbol: class SpringBootServletInitializer
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[15,9] method does not override or implement a method from a supertype
[INFO] 3 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.349 s
[INFO] Finished at: 2020-03-20T05:48:14-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project excel-api: Compilation failure: Compilation failure: 
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[6,44] package org.springframework.boot.web.support does not exist
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[9,34] cannot find symbol
[ERROR]   symbol: class SpringBootServletInitializer
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[15,9] method does not override or implement a method from a supertype
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-properties-migrator</artifactId>
    <scope>runtime</scope>
</dependency>
[ERROR] /home/developer/git/SOC-dashboard/src/main/java/com/springboot/excelapi/Application.java:[9,34] cannot find symbol
[ERROR]   symbol: class SpringBootServletInitializer