I have a maven2 project, consisting of root project (with pom packaging) and a set of modules having dependencies on each other. The project is a library with a set of apps built on top of this library. Now the problem.
My library uses some resources which cannot be packed in jar – namely some sqlite databases, and I can’t find a way to put it near the jar instead of inside it, and to buldle library this way to dependent applications.
Thanks. Any ideas?
Create a custom assembly to distribute the project as an archive (e.g. a
ziportar.gz) is clearly the way to go here.To customize the way the Assembly Plugin creates your assemblies, you’ll need to provide your custom descriptor (this gives you all the flexibility you need). Then, to build the assembly as part of the build, all you have to do is to bind the
singleorsingle-directorymojos into the default build lifecycle as explained in the Configuration and Usage of the plugin’s documentation.Another great resource is Sonatype’s book which has an entire chapter dedicated to assemblies: see Chapter 14. Maven Assemblies .