創建zip文件我使用行家組裝插件創建ZIP,我怎麼能重命名一些文件,而使用相同的插件荏苒?重命名文件,同時通過Maven的組裝插件
更新:
這是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>
輪廓這是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>
我得到那個罐子和拆包,然後重命名文件並再次壓縮。 感謝
你能顯示你正在使用的pom文件和描述符嗎? – khmarbaise 2013-05-14 16:18:23
嗨,感謝您的回覆。我已更新。 – 2013-05-15 04:59:44
你確定你的描述符是正確的,導致它看起來不正確(dependencySet)沒有依賴關係集。你沒有警告?此外,爲什麼不使用最新版本的maven-assembly-plugin(2.4)。 – khmarbaise 2013-05-15 09:04:09