javascript
SpringCloud中父子pom的结构和写法
整體結構如下:
(Python3.6) appleyuchi@Desktop:~/桌面/spring-cloud-example/Eureka Server注冊中心
$ tree
.
├── application.yml
├── hellotest.iml
├── Module
│???├── hellotest2.iml
│???├── pom.xml
│???├── src
│???│???└── main
│???│??? ? ?└── java
│???│??? ? ? ? ?└── org
│???│??? ? ? ? ? ? ?└── fkit
│???│??? ? ? ? ? ? ? ? ?└── EurekServerApplication.java
│???└── target
│??? ? ?├── classes
│??? ? ?│???└── org
│??? ? ?│??? ? ?└── fkit
│??? ? ?│??? ? ? ? ?└── EurekServerApplication.class
│??? ? ?├── generated-sources
│??? ? ?│???└── annotations
│??? ? ?├── hellotest2-0.0.1-SNAPSHOT.jar
│??? ? ?├── maven-archiver
│??? ? ?│???└── pom.properties
│??? ? ?└── maven-status
│??? ? ? ? ?└── maven-compiler-plugin
│??? ? ? ? ? ? ?└── compile
│??? ? ? ? ? ? ? ? ?└── default-compile
│??? ? ? ? ? ? ? ? ? ? ?├── createdFiles.lst
│??? ? ? ? ? ? ? ? ? ? ?└── inputFiles.lst
├── pom.xml
├── target
│???└── classes
└── 啟動說明.txt
完整工程代碼示例
?
總結寫法:
①父pom.xml中的packaging標簽里面是pom而不是jar這是因為頂層暫時沒有代碼,
如果頂層也有src/main/java 的代碼文件,那么此處就需要改成pom
②父pom.xml必須要制定<Module>標簽(這頂子模塊的路徑),如果要使用springboot則必須要有<parent>標簽
③并且父子各自的pom.xml中的parent標簽寫法都不一樣.
④父pom引入的依賴子模塊就不要引入了
⑤父pom的dependencyManagement可以用來管理版本
總結
以上是生活随笔為你收集整理的SpringCloud中父子pom的结构和写法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 刷卡机怎么用 刷卡机是怎么使用的
- 下一篇: Springboot版本+ Spring