我正在从以下内容中生成一个名为 foo.bar.zip
的 Artifact ...
我的 pom.xml 插件入口是这样的:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptor>src/assembly/bin.xml</descriptor>
<finalName>foo.bar</finalName>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
我的描述 rune 件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<formats>
<format>zip</format>
</formats>
<fileSets>
etc. etc.
我的问题是,如何生成带有自定义扩展名的文件?例如。使用名称
foo.bar
而不是 foo.bar.zip
。
最佳答案
Assembly 仅支持以下格式:
"zip" - Creates a ZIP file format
"tar" - Creates a TAR format
"tar.gz" or "tgz" - Creates a gzip'd TAR format
"tar.bz2" or "tbz2" - Creates a bzip'd TAR format
"jar" - Creates a JAR format
"dir" - Creates an exploded directory format
"war" - Creates a WAR format
您应该考虑在以后的目标/阶段使用 antrun plugin 来重命名文件扩展名
关于Maven 程序集插件 - 如何生成具有自定义文件扩展名的 Artifact ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36777725/