在ant构建中设置类路径
我在 MANIFEST.MF 文件中定义的类路径引用了一个包含所有必需 jar 的目录,并且我想添加对不在该目录内的 jar 的引用。应用程序应从 MANIFEST.MF 文件内的路径加载此 jar。
像这样的:
类路径:lib/something.jar lib/anything.jar lib/m16.jar lib/apache.jar
和想要的是这样的:
类路径:lib/something.jar lib/anything.jar lib/m16.jar some/other/path/lib/apache.jar
感谢您的任何建议,
my classpath defined in the MANIFEST.MF files references to a dir with all the required jars in it, and I would like to add a refference to a jar that is not located inside that directory. This jar should be loaded by the application from the path that was inside the MANIFEST.MF file.
something like this:
Class-Path: lib/something.jar lib/anything.jar
lib/m16.jar lib/apache.jar
and the wanted is like this:
Class-Path: lib/something.jar lib/anything.jar
lib/m16.jar some/other/path/lib/apache.jar
Thanks for any suggestions,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能有更好的方法,但一个简单的选择是在项目中保存 MANIFEST.MF 文件的副本,然后修改类路径,使其满足您的要求。然后,您可以在构建文件的
条目中指定要使用的特定清单,如下所示:There may be a better way, but one simple option would be to save a copy of your
MANIFEST.MF
file in your project and then amend the classpath so that it meets your requirements. Then you can specify the specific manifest to use in the<jar>
entry of your build file, something like this: