1
我有一个ANT构建,编译我的Java项目并构建一个jar。 ANT目标为jar创建清单类路径。一切都很好。Apache ANT清单类路径文字
现在,我想添加一个句点'。'到清单类路径的开始处,以便运行时工作目录位于类路径中。我如何使用manifestclasspath
来做到这一点?
我manifestclasspath例如:
<manifestclasspath property="foobar.manifest.classpath" jarfile="whocares.jar">
<classpath >
<pathelement path="."/>
<!-- :-(adds the working directory of the build. -->
<pathelement location="lib/some.jar"/>
<pathelement location="lib/someother.jar"/>
<fileset dir="${foobar.lib.dir}">
<include name="**/*.jar" />
</fileset>
</classpath>
</manifestclasspath>
<pathelement path="."/>
添加工作构建的目录我的清单类路径这不是我想要的。我只想要一段时间。
这就是我想要的JAR的类路径看起来像:
Class-Path: . lib/some.jar lib/someother.jar lib/blah.blah.blah.blah.b
lah.blah.jar /lib/and-on-and-on.jar
事情的关键是在“.
”作为在classpath中的第一个项目。
如何让ANT将文字'.
'添加到清单类路径中?
什么是你想通过添加文字来实现“” ?无论如何,jar中的类不是可以自动访问的吗? – Kal 2011-05-04 21:10:04
我正在从运行时工作目录中的属性文件中加载重写属性。 – MarkOfHall 2011-05-04 21:21:24
看着代码,路径应该总是相对于你指定的jar。如果“。”是你的项目的'basedir'和“whocares.jar”在“。”之内。那么你应该得到“。”在财产内部或它是一个错误(你应该报告它)。 – 2016-12-07 05:40:10