栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

ant,jar文件和Class-Path哦,我的

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ant,jar文件和Class-Path哦,我的

这就是您所需要的:

<path id="build-classpath">    <fileset dir="${dist}/lib">        <include name="*.jar"/>    </fileset></path><manifestclasspath property="lib.list" jarfile="${dist}/lib/myprog.jar">    <classpath refid="build-classpath"/></manifestclasspath><jar jarfile="${dist}/lib/myprog.jar"     basedir="${build}"     includes="com/my/prog/**" >    <manifest>        <attribute name="Main-Class" value="com.my.prog.MyProg"/>        <attribute name="Class-Path" value="${lib.list}"/>    </manifest></jar>

您可能会看到,它假设您已经编译了Java类并将它们输出到

${build}
。它还假设您已将jarfiles复制到
${dist}/lib

也就是说,值得研究其他对依赖项有内置支持的构建系统,例如Maven和Gradle。这些其他构建系统已经考虑了许多常见的项目结构和构建操作,因此您无需编写所有脚本,直到最后一个细节。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/404469.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号