0
如何將不包含文件的目錄結構複製到另一個根目錄中? 比如來自:Maven:複製無文件目錄結構
root
-> dir1
-> dir2
-> dir3
to:
another_root
-> dir1
-> dir2
-> dir3
如何將不包含文件的目錄結構複製到另一個根目錄中? 比如來自:Maven:複製無文件目錄結構
root
-> dir1
-> dir2
-> dir3
to:
another_root
-> dir1
-> dir2
-> dir3
可以使用maven-resource-plugin用於上述目的是這樣的:
<project>
...
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/extra-resources</outputDirectory>
<resources>
<resource>
<directory>src/non-packaged-resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
...
</build>
...
</project>
,但我不知道你是否可以配置的方式沒有他們的內容,只有文件夾將被複制。除此之外,你可以看看maven-copy-plugin,但它聽起來像你不去Maven的方式。
您想要實現什麼?你爲什麼需要這樣的事情? – khmarbaise