How do I include configuration files with Maven Appassembler?

I'm using the Maven Appassembler plugin to package my application. I'd like to package some configuration files with the application. I've found the configurationDirectory and includeConfigurationDirectoryInClasspath parameters, but I haven't found how I should create (and populate) that configuration directory. I've tried putting the files in src/main/resources, but that just puts them in the jar file for my project.

What is the "proper" way to do this, using maven?

-------------Problems Reply------------

Unfortunately this is a limitation of the appassembler plugin in the current release version. Typically, the plugin is used in conjunction with the assembly plugin to produce the final artifact, in which you can include the reference to your configuration directory. However, if you'd like to have a functional structure from just the appassembler plugin you need to manually copy the files into place. An example using the antrun plugin with a src/main/conf directory can be found here:

Apart from that is does not generate the bin scripts for different platforms. The maven-assembly-plugin can create (package(s) {tar.gz, zip}) for distribution. These are configured through a assemble.xml. You specify which files go in (with what options (chmod)), etc. It can also filter files (search/replace values within them). etc.

By default, the plugin uses the directory src/main/config.

Is possible to change the source for the config files using the parameter <configurationSourceDirectory>src/main/config</configurationSourceDirectory>

When I include the copyConfigurationDirectory property, it copies the config files and bundles them properly.


I have a different problem though. I would like to filter my config files before copying, which is giving me some trouble.

Category:configuration Views:2 Time:2010-01-18

Related post

Copyright (C), All Rights Reserved.

processed in 0.091 (s). 11 q(s)