java - Maven assembly descriptor properties -
i want pack 2 or more similar distributions, difference path data set inside distributions.
given example path: ${project.basedir}/src/config/dataset1
<?xml version="1.0" encoding="utf-8"?> <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>dataset1</id> <formats> <format>zip</format> </formats> <filesets> <fileset> <directory>${project.basedir}/src/config/dataset1/aaa</directory> <outputdirectory>conf/aaa</outputdirectory> </fileset> <fileset> <directory>${project.basedir}/src/config/dataset1/bbb</directory> <outputdirectory>conf/bbb</outputdirectory> </fileset> </filesets> <!-- many more filesets... --> </assembly>
now want same assembly descriptor different data set, example: ${project.basedir}/src/config/dataset2
off course create 2 assembly descriptors. again have keep in mind change multiple places when needed, or worse when adding dataset or two.
is there way how solve this, creating multiple executions , passing properties it? or ever nicer?
thanks
edit: wish item solve everything: https://jira.codehaus.org/browse/massembly-445
yes, use properties this.
- create properties (with default value) parts differs between executions in
pom.xml
. e.g.:
<properties> <dataset.dir>config/dataset</dataset.dir> </properties>
use them in assembly descriptor other property (e.g
${project.basedir}
)for different executions could:
use several build profiles (maven profiles) override property value;
or pass values directly mvn call argument (like
mvn package -dprop=val
)
also, if want use these properties in other place, populate them via placeholders in config using other maven plugins (for instance, maven-resource-plugin).
Comments
Post a Comment