renaming a file while creating zip file through Maven-assembly plugin -
i using maven-assembly plugin create zip , how can rename files while zipping using same plugin??
update:
this profile in pom
<profile> <id>d1</id> <activation> <property> <name>d1</name> <value>true</value> </property> </activation> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-assembly-plugin</artifactid> <version>2.2.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <descriptors> <descriptor>assembly/online-distribution.d1.xml</descriptor> </descriptors> <appendassemblyid>false</appendassemblyid> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile>
this assembly.xml
<?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"> <formats> <format>tar.gz</format> </formats> <id>online</id> <includebasedirectory>false</includebasedirectory> <dependencyset> <outputdirectory>resources</outputdirectory> <unpack>true</unpack> <includes> <include>${project.groupid}:core-config:jar</include> </includes> <unpackoptions> <includes> <include>coresrv/env-config.d1.properties</include> </includes> </unpackoptions> </dependencyset> <files> <file> <source>${project.groupid}/core-config.jar/coresrv/env-config.d1.properties</source> <outputdirectory>/</outputdirectory> <destname>env-config.properties</destname> </file> </files> </assembly>
i getting jar , unpacking it, renaming file , zipping again. thanks
you can use
<outputfilenamemapping>...</outputfilenamemapping>
which sets mapping pattern dependencies included in assembly uses
default value:
${artifact.artifactid}-${artifact.version}${dashclassifier?}.${artifact.extension}.
Comments
Post a Comment