作者:何俊雨_127 | 来源:互联网 | 2024-10-21 14:44
idea创建maven项目1.创建父模块File-New-Project-MavenGroupId:com.sky.cloudArtifactid:sky-cloud-sta
idea创建maven项目
1.创建父模块
File->New ->Project->Maven
GroupId: com.sky.cloud
Artifactid: sky-cloud-starter-parent
Version: 1.0-SNAPSHOT
2.创建子模块(module)
GroupId: com.sky.cloud
Artifactid: sky-cloud-commons
Version: 1.0-SNAPSHOT
GroupId: com.sky.cloud
Artifactid: sky-cloud-base
Version: 1.0-SNAPSHOT
3 修改pom文件
- 3.1父模块’sky-cloud-starter-parent’的pom.xml
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">
4.0.0
org.springframework.boot
spring-boot-starter-parent
1.5.3.RELEASE
pom
1.8
UTF-8
UTF-8
-Dfile.encoding=UTF-8
1.7.0
false
com.sky.cloud
sky-cloud-starter-parent
1.0-SNAPSHOT
sky-cloud-commons
sky-cloud-base
org.mybatis.spring.boot
mybatis-spring-boot-starter
1.1.1
com.alibaba
fastjson
1.2.17
- 3.2修改子模块’sky-cloud-commons’的pom.xml
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">
4.0.0
sky-cloud-starter-parent
com.sky.cloud
1.0-SNAPSHOT
sky-cloud-commons
javax.servlet
javax.servlet-api
- 3.3修改子模块’sky-cloud-base’的pom.xml文件
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">
sky-cloud-starter-parent
com.sky.cloud
1.0-SNAPSHOT
4.0.0
sky-cloud-base
com.sky.cloud
sky-cloud-commons
${project.version}
org.springframework
spring-core
org.springframework.cloud
spring-cloud-starter-eureka
1.2.3.RELEASE
org.springframework.cloud
spring-cloud-starter-eureka-server
1.2.3.RELEASE
org.springframework.boot
spring-boot-starter-web
最终目录结构如下:
![Paste_Image.png](http://upload-images.jianshu.io/upload_images/5830798-7fe688657eda1e85.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
执行
Paste_Image.png
生成jar包,供后续spring-cloud微服务使用