add_jar and resources - relative path question

I am using add_jar with reasonable success, except . . .

I want to add graphic resources, which I am able to do ONLY by specifying relative paths (which itself is a little strange); but, that isn’t exactly the problem.

The issue is that the relative path becomes the resource path within the jar file.

I need to be able to specify the resource path as it will appear in the jar.
I am collecting resource files from various paths, but want them all within a single namespace.

So, let’s say, I have :

SRC / path / to / resource1
SRC / path / to / another / resource2

in the jar file I want them appear like this:

[jar] . my.name.space.resources.resource1
[jar] . my.name.space.resources.another.resource2

Currently, I don’t see a way to make that happen.

I can get the resources to appear within the jar, but they appear in their own relative paths. ex:

path.to.resource1
path.to.another.resource2

What’s the best way to accomplish this ?

Thanks for the help

I think Java cares a lot about the on-disk structure, so you might need to have my/name/space in your source tree. But that’s just my observation; there may be ways of injecting a prefix to a tree.

Currently, the only possibility, as explained by @ben.boeckel is to organize your sources in the expected file tree.

Actually, I found it easier to add a parameter to add_jar.

I’ll submit a patch