<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.springboot</groupId>
<artifactId>excel-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Excel API with Spring Boot</name>
<description>Spring Boot - working with Excel API</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-data</artifactId>
</dependency>
<!-- Start of excel dependencies -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11</version>
</dependency>
<!-- End of excel dependencies -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
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
这是一次主要的spring版本升级,从1.x升级到2.x。在这类重大版本升级过程中,通常会发生一些重大的更改,如包重组、删除不推荐使用的类/方法等。最好参考一些迁移指南来进行这类升级。您可以参考官方的迁移指南或一些其他的博客,比如这个。
Spring提供了一个可以添加到pom文件中的依赖模块。该模块分析应用程序并提供所需更改的诊断输出。
<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
我发现这是一个与版本相关的问题,我尝试了提供的所有解决方案,但似乎都不起作用。这里是我的pom.xml https://maven.apache.org/xsd/maven-4.0.0.xsd“>4.0.0 org.springframework.boot spring-boot-starter-parent 2.2.6.release com.finalapplication Fxykxll 0
我所尝试的: 根据此线程编辑settings.xml文件时,无法将工件org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1from/to central(http://repo1.maven.org/maven2) 正在删除Maven中的.m2文件夹 使缓存无效并重新启动 我见过很多stackoverflow帖子,但不幸的是,它们似乎都不
我当前的spring boot项目有spring boot starter父级依赖关系pom文件,版本为1.5.release。有没有可能升级到2.0版本。如果是的话,我们如何做到这一点呢?
我正在遵循以下指南:https://spring.io/guides/gs/service-web-content/, 但我在POM上遇到了这个问题: 但在这里是https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/2.4.0
我创建了几个Spring Boot项目,每个项目的POM都包括一个spring-boot-starter-parent作为父级。每当一个新版本出来,我目前需要手动更新它在每个POM。