0
我想从依赖中获取资源文件并将其放到我的类路径或其他目录中。我尝试了maven-dependency-plugin,但似乎我没有正确配置它。有谁知道该怎么做?如何从相关工件中获取资源文件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>get browsers.xml</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<includeGroupIds>ru.fad.autotests</includeGroupIds>
<includeArtifactIds>selenium-grid-browsers-local</includeArtifactIds>
<includes>browsers.xml</includes>
<outputDirectory>resources/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
我在另一个工件中有'browsers.xml'文件,并且想将其复制到我的目录中。
请分享确切的代码并详细说明您正在尝试做什么。 – 2013-02-28 15:51:25
你能否更具体地说明你的意思是“复制到我的目录?”你的项目结构中的哪个目录?另外,“但似乎我没有正确配置它” - 你能详细说明一下吗?与你想要做什么相比,目前它在做什么(错误?)? – noahlz 2013-02-28 19:47:50
我的文件'browsers.xml'位于从属工件的资源中。我必须将它复制到src/main/resources目录中。我没有收到任何错误。但是这个配置拷贝了meta-pom.xml,除了browsers.xml以外,还有目标目录。我不知道为什么:)如何才能正确地做到这一点? – 2013-03-01 09:41:33