Question

i've searched in inet and mvn documentation, but can't find the sollution.

I am using maven-assembly plugin to zip my application. When I make package, I recive such zip file:

abc-uat.zip----> abc__                           
                        |_bin
                        |_properties
                        |_....

My goal is: No 'abc' folder should present in archive.

abc-uat.zip---->                           
                    |_bin
                    |_properties
                    |_....

My Pom:

        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.2.1</version>
            <executions>

                <execution>
                    <id>make-uat</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                    <configuration>
                        <descriptors>
                            <descriptor>${basedir}/environments/uat/assembly/assembly.xml</descriptor>
                        </descriptors>
                        <finalName>abc</finalName>
                        <appendAssemblyId>true</appendAssemblyId>
                        <workDirectory>${project.build.directory}/${project.artifactId}/work/abc-dev</workDirectory>
                        <outputDirectory>${project.build.directory}/${project.artifactId}/output</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

My assemby:

<id>uat</id>
<formats>
    <format>zip</format>
</formats> 

<fileSets>

    <fileSet>
        <directory>${basedir}/environments/uat</directory>
        <outputDirectory>/</outputDirectory>
        <includes>
            <include>/**/*.sh</include>
            <include>/**/*.properties</include>
        </includes>
    </fileSet> 

</fileSets> 

Was it helpful?

Solution

You have to add the following line to your assembly-descriptor like:

<includeBaseDirectory>false</includeBaseDirectory>

OTHER TIPS

Already found the solution. 1. Greate documentation for maven-assembly = http://allan.keithics.com/ebooks/maven/MavenTheDefinitive%20Guide/assemblies.html

2.Answer:

<assembly> 
<includeBaseDirectory>false</includeBaseDirectory>
</assembly>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top