load the resources through the classloader
Sent from my [rhymes with myPod] ;-)
On 13 Feb 2009, at 17:30, Costin Caraivan <[email protected]> wrote:
Hello,
This will be a newbie question, regarding resource relocation at
build time.
It goes like this: I code something, that maybe loads
some .properties and
some images. I need the paths to those files, so I hardcode them.
Maybe I
even use another .properties file to load these paths at runtime -
but I
still need to hardcode the path to this file (or give it as an
command line
option, let's say).
Anyway, Maven wants a certain structure, it wants the resources in
src/main/resources (I know it can be configured). But when it builds
the
project jar, the resources are moved from that folder.
So:
compile time (in an IDE for example, like Eclipse):
src/main/java/classes
src/main/resources/resources
jar time:
classes
resources
How do you cope with this relocation? If I move everything in
src/main/resources, I'll break the code when compiling with
something like
Eclipse (while debugging for example). If I don't, I break Maven
(the build
is more complex, I can't really change the resource folder using
<resources>
for various reasons).
How do you handle your resources when building with Maven? You just
put the
resources in src/main/resources... and what happens when you run
your jar?
Thank you for your answers,
Costin.
--
View this message in context:
http://www.nabble.com/src-main-resources-and-hardcoded-paths-tp22001032p22001032.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]