The problem:
I have resources OUTSIDE the jar like config files
that have to be edited by the user and resources IN
the jar, so that the user cannot accidently delete
or willingly replace them. Images, for example.
Using those in a (SWT-)class would look like:
Image img01 = new Image(display, "/img/nice.png");
This will look up for a file nice.png in a subfolder
"img" packed in the jar along with the classes:
JAR
--com/mycompany/swtapp/MyClass.class
|-img/nice.png
But ONLY if the manifest File contains an extra
entry
ClassPath: img
If this is not explicitely written in the
MANIFEST.MF, the app throws a NullPointer.
I tried the tag:
<addClasspath>true</addClasspath>
but this only adds the dependency classpath
Do I have to define the img-folder as a
dependency?
I tried to use
<manifest><classPath>img</classPath></manifest>
but mvn didn't recognize the tag (of course).
I had to specify a custom manifest file
with
<manifestFile>src/main/META-INF/MANIFEST.MF</manifestFile>
looking like this:
Main-Class: com/mycompany/swtapp/App
Class-Path: img
just for the simple Task of adding a
ClassPath entry to the manifest file.
OK, it did what I expected, but isn't there a
more elegant way to do it? For example a simple
<classPathEntry>-Tag in the archiver plugin
could do the work.
__________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]