You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by to...@gi-de.com on 2008/03/07 12:22:26 UTC

assembly.xml of mixed and not unpacked as expected

Hi, 

I have an assembly.xml file with mixed <fileSets> and <files> like:

<assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/assembly-1.0.0.xsd" xmlns="
http://maven.apache.org/POM/4.0.0">
        <!--<id>install</id>-->
        <formats>
          <format>zip</format>
        </formats>
        <includeBaseDirectory>false</includeBaseDirectory>

        <fileSets>
        <!-- doesnt´t work in a multi-module build.....-->
        <!-- 
                <fileSet>
                        <directory>src/main/config</directory>
                        <outputDirectory/>
                        <filtered>true</filtered>
                        <includes>
                                <include>**/*.bat</include>
                                <include>**/*.sh</include>
                        </includes>
                </fileSet>
        -->
                <fileSet>
                        <directory>src/main/config</directory>
                        <outputDirectory/>
                        <includes>
                                <include>**/*.properties</include>
                        </includes>
                </fileSet>
        </fileSets>

        <files>
                <file>
 <source>${basedir}/src/main/config/update-db2.bat</source>
                        <filtered>true</filtered>
                </file>
                <file>
 <source>${basedir}/src/main/config/update-db2.sh</source>
                        <filtered>true</filtered>
                </file>
        </files>
</assembly>

The created zip-File looks o.k., there´s no path in it. I could extract it 
with Winzip and all files come to the same directory.

But when I extract the zip with dependency:unpack the <fileSet> files go 
to the configured outputDirectory, 

        C:\delivery\version\Install/Datenbank/UpdateDB\*.properties

but the <files> files go to my current root directory !!!

        S:\*.bat
        S:\*.sh

Here´s the pom.xml snippet to unpack the stuff:

<plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <!-- entpacken der zum Buildzeitpunkt gezippten *.bat und *.sh 
etc. Files, die im Repo neben dem updatedb.jar liegen -->
          <execution>
            <id>unpack</id>
            <phase>package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
                    <artifactItems>
                        <artifactItem>
 <groupId>com.gide.gdcams</groupId>
 <artifactId>gdcams-updatedb</artifactId>
 <version>${version}</version>
                              <type>zip</type>
 
<outputDirectory>${gdcams.delivery_dir}/${productVersion}/Install/Datenbank/UpdateDB</outputDirectory>
                      </artifactItem>
                    </artifactItems>
            </configuration>
          </execution>
 
        </executions>
</plugin> 

=> Why is there a difference ?
=>  What´s the secret behind packing files into a zip with <files> or with 
<fileSets> ?

All I want, is packing some filtered files in a multi-module build, and 
unzipping them later while delivery.


Thanx, torsten