我在inet和mvn文档中搜索过,但找不到溶剂。
我正在使用maven-assembly插件来压缩我的应用程序。当我打包时,我会收到这样的zip文件:
abc-uat.zip----> abc__
|_bin
|_properties
|_....
我的目标是:档案中不应出现'abc'文件夹。
abc-uat.zip---->
|_bin
|_properties
|_....
我的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>
我的组合:
<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>
答案 0 :(得分:3)
您必须将以下行添加到程序集描述符中,如:
<includeBaseDirectory>false</includeBaseDirectory>
答案 1 :(得分:1)
已经找到了解决方案。 的 1。为maven-assembly = http://allan.keithics.com/ebooks/maven/MavenTheDefinitive%20Guide/assemblies.html
创建文档<强> 2. 答案: 强>
<assembly>
<includeBaseDirectory>false</includeBaseDirectory>
</assembly>