【发布时间】:2013-03-05 23:50:40
【问题描述】:
我有一个来自某个构建的 EAR 文件。我想将此 EAR 文件的内容提取到另一个文件夹中。我很困惑如何做到这一点。我已经看过并尝试过 http://maven.apache.org/plugins/maven-ear-plugin/ 和 http://maven.apache.org/plugins/maven-dependency-plugin/usage.html
但是 maven 无法找到该文件或存在依赖问题。
由于我是 maven 新手,我不明白如何设置这些插件。
使用以下插件时出现以下错误。
在http://repo.maven.apache.org/maven2 中找不到 ECM:ECM:ear:1.0 失败已缓存在本地存储库中
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>ECM</groupId>
<artifactId>ECM</artifactId>
<version>1.0</version>
<type>ear</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/earoutput</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
-
我厌倦了 maven 中的 ant 插件,它可以工作。但我不确定这是否是最好的方法。
-
您的 Maven 配置为查找哪些存储库?其他构建(从中获取 EAR 文件)在哪里部署工件 (EAR)?如果它们不是相同的存储库,您可能需要在 settings.xml 中配置另一个存储库。或者只是将工件结构复制到本地 Maven 存储库。