views:

88

answers:

1

I have a single configuration file which I would like to include as a dependency in a maven pom.xml. I want to keep around several versions of this, and have it appear in the classpath. I realize I could wrap it in a jar, but others in my team would like to easily inspect its contents. Looking at the types allowed in the pom.xml, I only see things like pom, jar, war, ear, ... Basically just archives of some sort. So I'm wondering what the pom.xml might look like to package a single file. I would imaging the maven artifacts on inspecting the server to be something like

myconfig-0.0.1.cfg
myconfig-0.0.1.cfg.md5
myconfig-0.0.1.cfg.sha1
myconfig-0.0.1.pom
myconfig-0.0.1.pom.md5
myconfig-0.0.1.pom.sha1

So is this possible? What would the pom.xml look like?

+1  A: 

I would wrap the configuration file in a jar and use the Dependency plugin to dependency:unpack the jar during the generate-resources phase (see the Unpacking specific artifacts example). This would allow to version it easily, to add it as dependency easily, and to inspect it easily.

Pascal Thivent