`
dreamoftch
  • 浏览: 486566 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

ant build.xml compile 编译 指定 jar

    博客分类:
  • ant
阅读更多
<?xml version="1.0" encoding="UTF-8" ?>
<project name="HelloWorld" default="run" basedir=".">
<property name="src" value="src"/>
<property name="dest" value="classes"/>
<property name="jar_name" value="helloWorld.jar"/>
<property name="lib.dir" value="lib" />
<target name="init">
   <mkdir dir="${dest}"/>
</target>
<path id="classpath">
	<fileset file="${lib.dir}/*.jar" />
</path>
<target name="compile" depends="init">
   <javac srcdir="${src}" destdir="${dest}">
        <!-- 这里指定依赖的lib库路径 -->
   	<classpath refid="classpath" />
   </javac>
</target>
<target name="build" depends="compile">
   <jar jarfile="${jar_name}" basedir="${dest}"/>
</target>
<target name="run" depends="build">
   <java classname="test.ant.HelloWorld" classpath="${hello_jar}"/>
</target>
<target name="clean">
   <delete dir="${dest}" />
   <delete file="${hello_jar}" />
</target>
<target name="rerun" depends="clean,run">
   <ant target="clean" />
   <ant target="run" />
</target>
</project>

 

分享到:
评论

相关推荐

    Ant工具build文件使用的简单示范

    主要是做了一个范例示范怎么使用build.xml来编译java项目。操作有:clean, compile, run, jar.

    WSDD + TOMCAT 一键部署Webservices

    [javac] D:\java\wsdd\build.xml:16: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 5 source files to D:\java\...

    itext-2.1.7.js7.jar

    Error POM for ...&lt;scope&gt;compile &lt;optional&gt;false &lt;groupId&gt;org.bouncycastle &lt;artifactId&gt;bcmail-jdk15on &lt;groupId&gt;org.bouncycastle &lt;artifactId&gt;bcpkix-jdk15on &lt;/dependency&gt;

    fckeditor for jsp 的jar包

    这个是一个我修改过的fckeditor ...打开build.xml,修改property name="catalina.home"成Tomcat的安装目录。修改taskdef name="deploy"、taskdef name="list"、taskdef name="reload"、taskdef name="undeploy"如下: ...

    ant1.9资源

    若文件名为hello.xml时,读者还需要对命令做少许改变,改为:ant –f hello.xml sayHelloWorld、ant –buildfile hello.xml sayHelloWorld或ant –file hello.xml sayHelloWorld。 接下来开始向读者讲解本节的重点...

    maven常用命令.docx

    一、maven常用命令: 1.mvn clean 清空产生的项目( target里) ...11.mvn test -skipping compile -skipping test-compile 只测试而不编译,也不测试编译 12.mvn deploy 13.mvn source.jar 源码打包

    AXMLPrinter2、baksmali、smali、dex2jar

    1、用AXMLPrinter2.jar反编译xxx.xml文件 解压xxx.apk,选择main.xml(也可选择其它xml文件...则是因为Java Compile Level和指定编译的JRE两者间的版本不一致导致;我的处理方法是重新按装JRE较高版本(我原来的是5.0)

    apache-ant-1.9.3-src.tar

    注:我看到很多项目的ant脚本中的命名基本上都是一致的,比如:编译一般叫build或者compile;打包一般叫jar或war;生成文档一般命名为 javadoc或javadocs;执行全部任务all。在每个任务的中,ANT会根据配置调用一些...

    memtester-4.5.0.tar

    下载之后解压文件,使用make && make install 解压安装。 这个是使用方法 http://www.360doc.com/content/19/0403/19/99071_826230532.shtml

    Basics.Of.Compile.Design

    Basics.Of.Compile.Design

    spring mvc +freemarker不错的mvc搭配1.1

    spring mvc +freemarker不错的mvc搭配 ...一、原来的程序有问题,导致maven...3.mvn compile 编译、mvn package打包、eclipse-&gt;Run on Server运行通过。 4.运行环境:默认jdk1.6.0_23,Maven以及相关环境变量已经配置好。

    Ant脚本打包Android程序的demo 多渠道及第三方JAR打包

    build是在build_with_bat的基础上实现的,主要是在compile和dex部分增加了第三jar的打包。 build_mulity_channel是多渠道打包脚本。该脚本需要ant-contrib-1.0b3.jar的支持。包中已包含,需要将其放到ant的lib...

    mtdorb1.0b8

    For build this project you can use ant (www.apache.org). Before build project rename file build.properties.pattern in build.properties and set specific for your machine parameters, then start build....

    Android代码-FancyAlertDialog-Android

    Add this in your root build.gradle file &#40;not your module build.gradle file&#41;: allprojects { repositories { ... maven { url "https://jitpack.io" } } } Dependency Add this to your module's ...

    Android代码-FancyGifDialog-Android

    Add this in your root build.gradle file &#40;not your module build.gradle file&#41;: allprojects { repositories { ... maven { url "https://jitpack.io" } } } Dependency Add this to your module's ...

    Android代码-Animated-Icons

    Add this to your module build.gradle file: dependencies { ... compile "com.github.tarek360:Animated-Icons:1.2.0" } Add this to your root build.gradle file &#40;not your module build.gradle file&#41;...

    Android代码-FancyFacebookBadge-Android

    Add this in your root build.gradle file &#40;not your module build.gradle file&#41;: allprojects { repositories { ... maven { url "https://jitpack.io" } } } Dependency Add this to your module's ...

    第11.25节 Python正则表达式编译re.compile及正则对象使用.rar

    第11.25节 Python正则表达式编译re.compile及正则对象使用.rar

    Android代码-Simple Android SharedPreferences wrapper

    Add this in your root build.gradle file &#40;not your module build.gradle file&#41;: allprojects { repositories { ... maven { url "https://jitpack.io" } } } Dependency Add this to your module's ...

    Android代码-Toasty

    Add this in your root build.gradle file &#40;not your module build.gradle file&#41;: allprojects { repositories { ... maven { url "https://jitpack.io" } } } Dependency Add this to your module's ...

Global site tag (gtag.js) - Google Analytics