社区
Java SE
帖子详情
Ant中如何引用第三方的jar包,怎么在build.xml中配置
YvoXia
2007-08-07 04:10:51
如题!
...全文
951
2
打赏
收藏
Ant中如何引用第三方的jar包,怎么在build.xml中配置
如题!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
seventhfox1
2012-06-02
打赏
举报
回复
有用的其实是这部分
<path id= "compile.classpath ">
<pathelement path = "${webinf.dir}/lib/commons-beanutils.jar "/>
<pathelement path = "${webinf.dir}/lib/commons-digester.jar "/>
<pathelement path = "${webinf.dir}/lib/struts.jar "/>
<pathelement path = "${webinf.dir}/classes "/>
<pathelement path = "${classpath.external} "/>
<pathelement path = "${classpath} "/>
</path>
IhaveGotYou
2007-08-07
打赏
举报
回复
我抄一个例子给你,自己去领会吧。
build.properties:
classpath.external=C\:\\ExadelStudio\\lib\\servlet\\2.3\\servlet.jar;
build.xml:
<project name="empty" basedir="../" default="build">
<!-- Local system paths -->
<property file="${basedir}/ant/build.properties"/>
<!--property name="deploy.dir" value="${exadel.home}/tomcat/webapps"/-->
<property name="webroot.dir" value="${basedir}/WebContent"/>
<property name="webinf.dir" value="${webroot.dir}/WEB-INF"/>
<property name="build.dir" value="build"/>
<!-- Project settings -->
<property name="project.distname" value="empty"/>
<!-- classpath for Struts 1.1 -->
<path id="compile.classpath">
<pathelement path ="${webinf.dir}/lib/commons-beanutils.jar"/>
<pathelement path ="${webinf.dir}/lib/commons-digester.jar"/>
<pathelement path ="${webinf.dir}/lib/struts.jar"/>
<pathelement path ="${webinf.dir}/classes"/>
<pathelement path ="${classpath.external}"/>
<pathelement path ="${classpath}"/>
</path>
<!-- Check timestamp on files -->
<target name="prepare">
<tstamp/>
</target>
<!-- Copy any resource or configuration files -->
<target name="resources">
<copy todir="${webinf.dir}/classes" includeEmptyDirs="no">
<fileset dir="JavaSource">
<patternset>
<include name="**/*.conf"/>
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</patternset>
</fileset>
</copy>
</target>
<!-- Normal build of application -->
<target name="compile" depends="prepare,resources">
<javac srcdir="JavaSource" destdir="${webinf.dir}/classes">
<classpath refid="compile.classpath"/>
</javac>
</target>
<!-- Remove classes directory for clean build -->
<target name="clean"
description="Prepare for clean build">
<delete dir="${webinf.dir}/classes"/>
<mkdir dir="${webinf.dir}/classes"/>
</target>
<!-- Build entire project -->
<target name="build" depends="prepare,compile"/>
<target name="rebuild" depends="clean,prepare,compile"/>
</project>
Jmeter+
ant
+jenkins接口层性能与自动化测试
3、
ant
介绍以及作用、
ant
下载及安装、
ant
build
.
xml
详解。 4、Jenkins 构建自动化平台、Jenkins 安装以及功能介绍、jenkins+
ant
+jmeter **整合,邮件服务通知设置。 5、本课程注重实践每一个知识点都有相对应的...
ant
打包项目
build
.
xml
关于
jar包
https://www.cnblogs.com/alfredinchange/p/5372657.html
IDEA
ant
生成javaWeb项目的
jar包
build
.
xml
文件模板
IDEA
ant
生成javaWeb项目的
jar包
build
.
xml
文件参考模板
Ant
编译打
jar包
build
.
xml
Ant
中
如何添加
第三方
jar包
依赖
如果使用
ant
进行java项目的编译部署,那怎么添加
第三方
jar包
的依赖呢?方法如下: 1.在项目的更目录下创建lib目录,并把所有需要的
第三方
jar包
放到此目录下。 2.在
build
.
xml
中
如下
配置
: <?
xml
version="1.0" encoding="UTF-8"?> <project name="MyTool" default="
build
" basedir=...
Java SE
62,614
社区成员
307,326
社区内容
发帖
与我相关
我的任务
Java SE
Java 2 Standard Edition
复制链接
扫一扫
分享
社区描述
Java 2 Standard Edition
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章