Maven: Extract dependency resources before test

风流意气都作罢 提交于 2019-12-04 08:36:40

Try something like this

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <version>2.4</version>
  <executions>
    <execution>
      <id>resource-dependencies</id>
      <phase>process-test-resources</phase>
      <goals>
        <goal>unpack-dependencies</goal>
      </goals>
      <configuration>
        <includeArtifactIds>my-artifact-id</includeArtifactIds>
        <includes>foobar.txt, loremipsum.xml</includes>
        <outputDirectory>${project.build.directory}/classes/xml-resources</outputDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>

Have a look at the unpack-dependencies parameters for detailed explanation or further information.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!