zoukankan      html  css  js  c++  java
  • maven 工程构建 之_____<dependencyManagement>标签

    <?xml version="1.0" encoding="UTF-8"?>
    <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.zyt</groupId>
        <artifactId>fusunDemo</artifactId>
        <version>1.0-SNAPSHOT</version>
        <modules>
            <module>zyt_biz</module>
            <module>zyt_frame</module>
        </modules>
        <packaging>pom</packaging>
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>com.zyt</groupId>
                    <artifactId>zyt_schema_core</artifactId>
                    <version>${schema.version}</version>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
        <profiles>
            <!--dat环境-->
            <profile>
                <id>DAT</id>
                <properties>
                    <schema.version>1.0-SNAPSHOT</schema.version>
                    <env>dat</env>
                </properties>
            </profile>
        </profiles>
    </project>

    这个是顶级父工程的pom.xml文件

    import com.jcraft.jsch.ChannelSftp;
    import org.apache.log4j.Logger;
    
    /**
     * @description:
     * @author: zhangyantao(张艳涛)
     * @createDate: 2020/11/23
     * @version: 1.0
     */
    public class SftpUtil {
        private static Logger log= Logger.getLogger(SftpUtil.class);
        private ChannelSftp sftp;
    }
    

    这个是子工程的一个类,这里的ChannelSftp 依赖的是顶级父工程的zyt_schema_core的依赖,但现在用不了依赖,

    不会引入实际依赖,能约束dependecies下的依赖的依赖使用,继承了版本定义,子模块需要dependency引入<次依赖>不要带<version>版本

    <?xml version="1.0" encoding="UTF-8"?>
    
    <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">
      <parent>
        <artifactId>zyt_biz_frame</artifactId>
        <groupId>com.zyt</groupId>
        <version>1.0-SNAPSHOT</version>
      </parent>
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>com.zyt</groupId>
      <artifactId>zyt_biz_frame_utility</artifactId>
      <version>1.0-SNAPSHOT</version>
    
      <name>zyt_biz_frame_utility</name>
      <!-- FIXME change it to the project's website -->
      <url>http://www.example.com</url>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.11</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>log4j-over-slf4j</artifactId>
          <version>1.7.25</version>
        </dependency>
        <dependency>
          <groupId>com.zyt</groupId>
          <artifactId>zyt_schema_core</artifactId>
        </dependency>
      </dependencies>
    
      <build>
    ...
      </build>
    </project>
  • 相关阅读:
    移植Linux2.6.38到Tiny6410_1GNandflash
    【转载】Mini6410启动过程
    【转载】Mini2440启动配置文件说明
    【转载】linux2.6内核initrd机制解析
    第十三章 StringTable
    第十二章 执行引擎
    第十一章 直接内存(Direct Memory)
    第十章 对象的实例化、内存布局与访问定位
    第九章 方法区
    第八章 堆
  • 原文地址:https://www.cnblogs.com/zytcomeon/p/14025873.html
Copyright © 2011-2022 走看看