maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Query Regarding assembly plugin
Date Wed, 13 Nov 2013 20:17:48 GMT
Set includeBaseDirectory to true in the assembly descriptor [1].

/Anders

[1] http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html


On Wed, Nov 13, 2013 at 3:54 PM, Vinayak Samak <vs.samak@gmail.com> wrote:

> Hi,
>
> I wanted to create zip out of directory. For that I am using
> maven-assembly-plugin.
> It looks like this :
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
>  <artifactId>maven-assembly-plugin</artifactId>
> <configuration>
> <appendAssemblyId>false</appendAssemblyId>
>  <descriptor>installer-assembly.xml</descriptor>
> <finalName>test</finalName>
>  </configuration>
> <executions>
> <execution>
>  <phase>package</phase>
> <goals>
> <goal>single</goal>
>  </goals>
> </execution>
> </executions>
> </plugin>
>
> My installer-assembly.xml looks like :
> <assembly>
>         <id>bin</id>
>         <formats>
>                 <format>zip</format>
>         </formats>
>         <fileSets>
>                 <fileSet>
>                         <directory>release/</directory>
>                         <outputDirectory>/</outputDirectory>
>  <includes>
>                                 <include>**/*</include>
>                         </includes>
>                         <excludes>
>                                 <exclude>**/spec/</exclude>
>                         </excludes>
>                 <fileMode>0770</fileMode>
>                 </fileSet>
>         </fileSets>
> </assembly>
>
>
> It creates test.zip for me.
> But when I unzip this "test.zip" into directory "dir", I get structure
> like :
> dir
> |-test
>      |-different files
>
> Query here is, is there any way to create a zip in such a way that, I will
> get following structure :
> dir
> |-different file
>
> Means it wont create folder name with test and then zip it with name
> test.zip.
> Instead of that, I want to zip content of folder with file name test.zip.
>
> Any kind of help will be appreciated.
>
>
>
>
> --
>
>
> *Thanks *
>
>
> *Vinayak S. Samak *
>
> *Please don't print this Email unless you really need to. This will
> preserve trees on planet earth.*
>
>
> *Save Electricity, Water & Paper!! Go green for better tomorrow :)*
>
> *[image: See full size image]*
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message