介绍配置pom.xml文件
配置应用程序。yml
今天就跟大家聊聊有关怎么在想法中创建一个SpringBoot的maven项目,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。
新建项目
选择maven项目及JDK,点击下一步:
选择好项目路径,输入项目名称,点击完成就可以啦:
创建完成效果:
配置pom.xml文件
新建项目需要引入SpringBoot的依赖,这里选择2.4.4版本。
完整pom文件如下:
& lt; ? xml version=?.0“,编码=癠TF-8" ?比; http://maven.apache.org/POM/4.0.0" & lt; project  xmlns=?; ,,,,,,,,xmlns: xsi=癶ttp://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"比; ,,,& lt; modelVersion> 4.0.0 ,,,& lt; parent> ,,,,,,,& lt; groupId> org.springframework.boot ,,,,,,,& lt; artifactId> spring-boot-starter-parent ,,,,,,,& lt; version> 2.4.4 ,,,,,,,& lt; relativePath/祝辞,& lt; !——, lookup parent 得到repository ——比; ,,,& lt;/parent> ,,,& lt; groupId> org.example ,,,& lt; artifactId> SpringBoot-Test ,,,& lt; version> 1.0 -snapshot ,,,& lt; properties> ,,,,,,,& lt; project.build.sourceEncoding> UTF-8 ,,,,,,,& lt; project.reporting.outputEncoding> UTF-8 ,,,,,,,& lt; java.version> 1.8 & lt;/java.version> ,,,& lt;/properties> ,,,& lt; dependencies> ,,,,,,,& lt; dependency> ,,,,,,,,,,,& lt; groupId> org.springframework.boot ,,,,,,,,,,,& lt; artifactId> spring-boot-starter-web ,,,,,,,& lt;/dependency> ,,,,,,,& lt; dependency> ,,,,,,,,,,,& lt; groupId> org.springframework.boot ,,,,,,,,,,,& lt; artifactId> spring-boot-starter-test ,,,,,,,,,,,& lt; scope> test ,,,,,,,& lt;/dependency> ,,,& lt;/dependencies> ,,,& lt; build> ,,,,,,,& lt; plugins> ,,,,,,,,,,,& lt; plugin> ,,,,,,,,,,,,,,,& lt; groupId> org.springframework.boot ,,,,,,,,,,,,,,,& lt; artifactId> spring-boot-maven-plugin ,,,,,,,,,,,& lt;/plugin> ,,,,,,,& lt;/plugins> ,,,& lt;/build> & lt;/project>
配置应用程序。yml
配置文件中需配置端口号(默认是80)和项目名称,当然不配置也可以正常启动,只不过为了区别于其他项目,还是配置完比较好。
#,服务端口号,默认80 服务器: ,,端口:8866 春天: #,服务名称 应用程序才能: null怎么在想法中创建一个SpringBoot的maven项目