springboot做maven聚合工程的父工程的pom.xml内容

44 篇文章 0 订阅
27 篇文章 0 订阅

<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>

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值