Distribution Manifest.mf 中的单个点(“.")是什么意思? [英] What does a single Dot (".") in Distribution Manifest.mf mean?

查看:47
本文介绍了Distribution Manifest.mf 中的单个点(“.")是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我对 Manifest.mf 文件中的类路径有点困惑.所以我想要的是从我的 distribution.jar 中外包一些 properties.files 并将它们放在它旁边而不改变 java-source-files.

lately I got a bit confused concerning class-pathes in Manifest.mf-files. So what I want is to outsource some properties.files out of my distribution.jar and put them next to it without changing java-source-files.

以下示例:此时我可以打开这样的属性文件:

Following example: At this time I can open a properties-file like this:

this.getClass().getClassLoader().getRessourceAsStream( "/config/jdbc.properties" );

jdbc.properties 位于名为resources"的 eclipse 源文件夹中,其中包含一个名为config"的包.现在,当我构建发行版时,我将它们外包到了 distribution.jar 旁边的文件夹中,但我仍然无法在不更改显示的源代码的情况下找到它们.

The jdbc.properties are located in an eclipse sourcefolder called 'resources' with a package named 'config'. Now when I build the distribution I outsource them in a folder next to the distribution.jar, but I still wonna find them without changing the shown sourcecode.

目前唯一有效的 generell 解决方案(没有绝对路径)是以下 manifest.mf:

Only generell solution which worked until now (without absolout pathes) was the following manifest.mf:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 17.1-b03 (Sun Microsystems Inc.)
Main-Class: com.ymene.Main
Class-Path: .

."在 Class-Path 中似乎指向 .jar 的根目录?我以前从未在任何清单文件中看到过这样的情况.所以我想知道,这是否是实现我完全不更改 java 源代码的愿望的正确方法,无论资源是在 jar 内部还是外部构建,只要路径相同即可.

The "." in Class-Path seems to point on the root of the .jar? I`ve never seen it like that before in any manifest files. So I wonder, if that is the right approach to achieve my wish to not change my java-sourcecode at all, no matter if the resource will be builded within or outside the jar as long as the path will be the same.

谁能告诉我,如果."在 manifest.fm 文件中会对我产生任何不良副作用吗?如果情况并非如此,是否可以使用 Ant 生成 Manifest.mf 类路径条目(."我的意思是)?或者有没有其他解决方案可以实现这一目标?

Can anyone tell me, if the "." in the manifest.fm file will have any undesired side effects for me? And if that wont be the case, is it possible to generate that Manifest.mf Class-Path entry (the "." i mean) with Ant? Or is there any other solution to achieve that?

在此先感谢您对本主题的任何帮助,ymen

Thanks in advance for any help on this topic, ymene

推荐答案

单点表示这个目录".

这篇关于Distribution Manifest.mf 中的单个点(“.")是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆