1.在cmd下,输入路径
2.输入
mvn clean package
3.报错Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7
4.在pom.xml中删除红色框部分
5.输入 java -jar springbootthymeleaf-0.0.1-SNAPSHOT.jar
报错,没有告诉程序啦个作为程序入口
在pom.xml添加依赖,并更新
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.shs.APP</mainClass>
<excludes>
<exclude>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclude>
<exclude>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
这个部分改为自己的东西
6.重新打包,输入