I have a module that is used by creating a custom class loader. The class loader should therefore be created with the path to the module and also all dependencies.
I'm looking for a way to make it productive to work with this mechanism in both dev and production environments.
I thought the build can generate two files listing all dependency paths. A 'dev' file and 'production' file (then in the code I'd choose the right file based on some system property):
So I'm looking for pointers to plugins & pom snippets to help me with this.
Some hints:
For the dev part, the Maven Dependency Plugin and its dependency:build-classpath
can help (and supports writing the output to a file). Another option would be to use the Maven AntRun plugin, it has access to the Maven runtime classpath, it should be easy to write the property to a file.
For the prod part, I assume you'll use the Maven Assembly Plugin or the Shade Plugin or another equivalent and I wonder if you couldn't generate a classpath entry in the MANIFEST.MF and rely on it.