Create a SpringBoot maven web project with intellij idea
Official documents: Building an Application with Spring Boot
Spring Boot project generator: SPRING INITIALIZR
使用 intellij idea 创建一个 SpringBoot maven 的 web 项目.
springBoot 官方文档: Building an Application with Spring Boot
spting Boot 项目生成器: SPRING INITIALIZR
点击 Spring Initializr
--- 点击 Next
这些 Maven
依赖可以在后期添加
项目的名称按照前边的model 名称即可,不需要进行修改
在项目创建之后, Spring Boot
会默认生成一些工具类的文件,这些文件可以不用保留在项目中
删除文件包括:
.maven
文件夹mvnm
文件mvnm.cm
文件
删除以上文件之后修改 .gitignore
文件,该文件为 git
仓库的忽略规则,其中有一点尤为重要
/target
必须修改为 **/target
,因为后期项目大多为多模块项目,因此必须将所有模块下编译后的文件目录设置为忽略
.gitignore
文件模板( .gitignore
template)
##ignore this file##
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
## all target dir ###
**/target
##filter databfile、sln file##
*.iml
*.mdb
*.ldb
*.sln
##class file##
*.com
*.class
*.dll
*.exe
*.o
*.so
# compression file
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.via
*.tmp
*.err
# OS generated files #
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db