<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.pc</groupId>
<artifactId>DA_Refactoring_Parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>DA_Refactoring_Parent</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-cloud.version>Finchley.SR4</spring-cloud.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.9.RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>../eurekaserver</module>
<module>../bs</module>
<module>../dqservernode</module>
<module>../dqc</module>
<module>../ds</module>
<module>../common-node</module>
<module>../common-driver</module>
<module>../gateway</module>
<module>../md</module>
<module>../mg</module>
<module>../sp</module>
<module>../ss</module>
</modules>
<!-- <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build> -->
</project>
common-driver依赖common-node dqc和mg依赖common-driver eureka和gateway单独不依赖其它
因为common-node和common-driver没有springboot的主启动类,所以只能使用maven插件的build,不能使用上图中的spring-boot-maven-plugin打包。否则会报错common-node和common-drvier中没有springboot的主启动类,其他各个节点中自己都有spring-boot-maven-plugin。
子模块中的pom.xml中引用父工程的内容,以下2种都可以,建议选第一种,第二种我提交代码到git后,同事更新下来后编译时候报错,同事使用eclipse的luna,我使用spring tool suits。
<parent>
<groupId>com.pc</groupId>
<artifactId>DA_Refactoring_Parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../DA_Refactoring_Parent</relativePath> <!-- lookup parent from repository -->
</parent>
<artifactId>ss</artifactId>
<name>ss</name>
<parent>
<groupId>com.pc</groupId>
<artifactId>DA_Refactoring_Parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.pc</groupId>
<artifactId>bs</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>bs</name>
<description>bs</description>