STS -- SpringBoot项目
一、创建父项目
步骤:
1. new Spring-Stater-Project (下一步直到完成)
(如果出现错误:JSONException: A JSONObject text must begin with '{' at character 0
解决方案:http --> https)
2. 将pom.xml中的jar 改为: pom
(如果pom文件报错: maven configuration problem
解决方案:加3.0.0
备注:如果还是出错,将pom该回jar,没错再改回来)
3.项目右键在java buile path中将source和libraries中的内容都去掉,(buile path ->
configure -> 全选中 -> remove)
二、 创建子项目
1. new Spring-Stater-Project (将Location的值改为: 父项目地址+/父项目名称+/子项目名称)next直到完成
2. 在pom.xml中删除原始的parent标签,添加一段:
创建项目时的Group
创建项目时的Artifact
创建项目时的Version
3. 在父项目的pom.xml中添加一段配置:
子项目名称
4. 同理建第2个第3个子项目也是如此
假设第一个子项目为公用项目,可在其它项目加依赖
公用项目Group
公用项目名称
公用项目Version