这里顺便学习了一般项目中的结构来搭建
首先创建一个module,作为parent-module,然后删除自动生成的src等目录,留下pom文件作为parent
并重写pom修改此pom的打包方式。
并且添加Module
<modules>
<module>nacos-provider-demo</module>
...
</modules>
同时将子包需要用到的共用依赖全部放入中,以便统一管理版本号。
这里需要注意的是,如果parent-pom已经继承了spring-boot-starter-parent,如下
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>cn.kiring</groupId>
<artifactId>nacos_service_discovery_demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>nacos_service_discovery_demo</name>
<description>Demo project for Spring Cloud Nacos Service Discovery</description>
<packaging&g