zoukankan      html  css  js  c++  java
  • Ant中的classpath

    Code
        <classpath>
          
    <pathelement path="${classpath}"/>
          
    <fileset dir="lib">
            
    <include name="**/*.jar"/>
          
    </fileset>
          
    <pathelement location="classes"/>
          
    <dirset dir="${build.dir}">
            
    <include name="apps/**/classes"/>
            
    <exclude name="apps/**/*Test*"/>
          
    </dirset>
          
    <filelist refid="third-party_jars"/>
        
    </classpath>

    对于classpath标签的两个属性——path和location:
    按照官网上的解释:
    location的值可以是一个文件(file),也可以是一个相对于当前根目录(project的basedir)的文件夹(directory),或者是一个带有绝对路径的文件(文件夹)
    path则表示的是一系列的用分号(“;”)或冒号(“:”)分隔开的location值。
    
    
    当然,也可以如上所示,在classpath标签中使用fileset、dirset,这样省事不少。

    在上面的代码中还提到了一个filelist标签。它代表了一组文件,相当于一个文件集合。但是这个文件集合中的文件并不是一定会存在。filelist的使用方式如下:

    <filelist 
        
    id="docfiles" 
        dir
    ="${doc.src}"
        files
    ="foo.xml,bar.xml"/> 

    <filelist 
        
    id="docfiles" 
        dir
    ="${doc.src}">
        
    <file name="foo.xml"/>
        
    <file name="bar.xml"/>
    </filelist>

    <!-- 其中的${doc.src}/foo.xml,${doc.src}/bar.xml并不一定会存在地 -->
  • 相关阅读:
    1045 | error connecting to master 'slave_user@192.168.0.75:3306'
    Mysql 主从复制
    ORACLE 优化
    淘宝高并发访问数据库设计
    jquery 操作select
    SpringBoot文档地址
    SpringMVC基础02——HelloWorld
    SpringMVC基础01——SpringMVC的知识结构体系
    docker快速入门01——docker安装与简单应用
    Maven项目构建利器05——Maven的生命周期
  • 原文地址:https://www.cnblogs.com/ungshow/p/1365663.html
Copyright © 2011-2022 走看看