目标是从存储库中获取最新的tar.gz
工件并将其解压缩到某个特定位置。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.enterprise</groupId>
<artifactId>skrillex</artifactId>
<version>${product.version}</version>
<type>tar.gz</type>
<outputDirectory>target/product</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
还有
<dependencies>
<dependency>
<groupId>com.enterprise</groupId>
<artifactId>skrillex</artifactId>
<version>${product.version}</version>
<type>tar.gz</type>
</dependency>
</dependencies>
但我们得到错误:
[INFO] --- maven-dependency-plugin:2.5.1:unpack (unpack-unix) @ ... ---
[INFO] Configured Artifact: com.enterprise:skrillex:[1.1.70,):tar.gz
Downloading: https://repo/com/enterprise/skrillex/[1.1.70,)/skrillex-[1.1.70,).tar.gz
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.5.1:unpack (unpack-unix) on project ...: Unable to resolve artifact. Could not transfer artifact com.enterprise:skrillex:tar.gz:[1.1.70,) from/to ext (repo....): IllegalArgumentException