![](/img/trans.png)
[英]Maven Eclipse: How to include custom folder (with files) into the “target” folder on build?
[英]How to include folder with resource in Maven build
我在文件夾中有一個機械手資源文件,並且在執行Maven安裝時想同時包含該文件夾和機械手資源文件。
這是項目結構:
項目>文件夾>機械手資源文件
項目> src>主> Java ...
在我的pom.xml文件中,添加了:
<resources>
<resource>
<directory>/Project/Folder</directory>
<includes>
<include>**/*.robot</include>
</includes>
</resource>
</resources>
當我執行Maven安裝時,我只看到jar中的機械手資源文件,但沒有看到它的文件夾。 如何使機器人資源文件位於文件夾內? 我是Maven的新手,所以我很感謝任何指導。 我已經看過此參考資料,但這沒有提供答案: http : //maven.apache.org/plugins-archives/maven-resources-plugin-2.6/examples/resource-directory.html
謝謝!
首先, <directory>
查找指定的文件夾,但不包括該文件夾本身。 其次,項目根目錄的符號不是Project
,而是${project.basedir}
。
指定一個比您要包含的目錄更高級別的目錄。
<resources>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>**/*.robot</include>
</includes>
</resource>
</resources>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.