目標は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