• maven课程 项目管理利器-maven 3-10 maven聚合和继承 4星


    本节主要讲了以下内容:

    1    maven聚合

    2    maven继承

    1    maven聚合

    <!--  聚合特有标签 -->
      <groupId>com.hongxing</groupId>
      <artifactId>hongxing-juhe</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>pom</packaging>
      
      
      <modules>
       <module>../hongxing-bige</module>
       <module>../hongxing-nange</module>
       <module>../hongxing-sanji</module>
      </modules>

    2    maven继承

    hongxing-parent父类项目做了四个操作

    a  pom.xml中package标签变为pom,

    b  junit version被提取,引用的地方用el表达式表示

    c  pom.xml引入junit

    d    hongxing-parent项目删除src和test文件夹(因为package标签为pom的项目不编译,该两个文件夹中引用junit注解的地方会报错,故删除)

    <!--   此处添加继承,把junit 让hongxing其他项目继承 -->
      <properties>
        <junitVersion>4.11</junitVersion>
        
      </properties>
    
    
      <dependencyManagement>
          <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>${junitVersion}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      </dependencyManagement>

    子项目hongxing-bige需要做两个操作即可

    a  继承父项目

    b  把子项目的版本号和依赖范围去除即可

    <!-- b哥去掉version和scope标签,继承hongxing-parent项目 -->
    
      <parent>
            <groupId>com.hongxing</groupId>
            <artifactId>hongxing-parent</artifactId>
            <version>0.0.1-SNAPSHOT</version>
      </parent>
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </dependency>
      </dependencies>
  • 相关阅读:
    opengles 2.0 渲染Yuv视频
    wzplayer for android 版本面世
    wzplayer for android V1.0快出炉了
    wzplayer for android V1.0快出炉了
    wzplayer for android V1.0
    opengles 2.0 渲染Yuv视频
    新浪微博发布案例
    前端开发单位em
    vue 做一个简单的TodoList
    jquery对类的操作,添加,删除,点击添加,再点击删除
  • 原文地址:https://www.cnblogs.com/1446358788-qq/p/9907119.html
Copyright © 2020-2023  润新知