What does the single dot (".") Mean in the Manifest.mf distribution?

Lately I've been a little confused about the class-pathes in the Manifest.mf files. So what I want is to outsource some properties.files from my .jar distribution and put them next to it without changing the java source files.

Next example: At this time, I can open the properties file as follows:

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

      

The jdbc.properties settings are located in the eclipse source folder called 'resources' with a package named 'config'. Now when I build a distro, I upload them to a folder next to the .jar distribution, but I still can't find them without modifying the source code shown.

The only generalized solution that worked so far (no absolute fixes) was the following .mf manifest:

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: .

      

"." in class-path seems to point to the root .jar? I've never seen this in manifest files before. So I wonder if this is the right approach to achieve my desire not to change my java-source code at all, regardless of whether the resource is being built inside or outside the jar, as long as the path is the same.

Can anyone tell me if "." in the manifest.fm file will there be any unwanted side effects for me? And if it isn't, is it possible to generate this Manifest.mf Class-Path ("me") entry with Ant? Or is there any other solution to achieve this?

Thanks in advance for any help on this topic, ymene

+2


source to share


1 answer


The single dot means "this directory".



+4


source







All Articles