【发布时间】:2015-05-15 11:42:52
【问题描述】:
我正在尝试从依赖项 jar 文件中提取一些 .exe 文件并将它们放在 ${project.build.directory}/classes/ 下。
但是当我执行时:
mvn clean 编译依赖:解包
我得到:
无法在简单项目上执行目标 org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack (default-cli):artifact 或 artifactItems 是必需 -> [帮助 1
我已验证依赖项在我的本地存储库中可用。
在下面的示例 pom 中,我使用了 junit 作为示例,但无论我列出哪个依赖项,我都会遇到相同的错误。
pom.xml:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/classes/externaltools</outputDirectory>
<includes>**/*.txt</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
【问题讨论】:
-
我知道它在 pom 中说 .txt 而我在问题中谈到了 .exe 文件。
标签: maven-3 maven-dependency-plugin