zoukankan      html  css  js  c++  java
  • 13.继承

    test范围的依赖不能传递,因此需要统一管理各工程中test范围依赖的版本

    [1]创建父工程(打包方式为pom)

    <groupId>com.company.test</groupId>
    <artifactId>Parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    

    [2]在子工程中引用父工程

    <parent>
    	<groupId>com.company.test</groupId>
    	<artifactId>Parent</artifactId>
    	<version>0.0.1-SNAPSHOT</version>
    	<!--填写以当前工程目录为基准的父工程的pom.xml文件的相对路径-->
    	<relativePath>../xx/pom.xml</relativePath>
    </parent>
    

    [3]将子工程中与父工程坐标中相同的内容删除,如删除子工程中的(也可以不删除)

    <groupId>com.company.test</groupId>
    

    [4]在父工程统一管理

    <dependencyManagement>
    	<dependencies>
    		<dependency>
    			<groupId>junit</groupId>
    			<artifactId>junit</artifactId>
    			<version>4.0</version>
    			<scope>test</scope>
    		</dependency>
    	</dependencies>
    </dependencyManagement>
    

    [5]记得在子工程中把版本号<version>4.0</version>删去,否则父工程的版本会被子工程覆盖

  • 相关阅读:
    css颜色表示法&颜色表
    css单位
    DOM与BOM
    position定位
    grid layout
    Linux禁止Ping方法
    tracert(traceroute)与ping
    服务器负载均衡技术的原理
    Struts2与webx的比较
    SpringAOP的原理
  • 原文地址:https://www.cnblogs.com/fatmanhappycode/p/12231220.html
Copyright © 2011-2022 走看看