[英]Maven: Enforce that a classpath resource exists at runtime
我想使用 Maven 在運行時類路徑中強制存在某些資源。
任何建議如何實現?
謝謝和親切的問候
奧利弗
編輯:顯然我的問題不夠精確。 我想確保 style.css 文件位於運行時類路徑的根目錄中。 我不關心這個資源是如何進入類路徑的。 我只想確保資源存在於運行時類路徑中。
也許你可以在你的 pom 文件中添加你的路徑
<build>
<resources>
<resource>
<directory>src/main/config</directory> //this
</resource>
</resources>
</build>
你試過了嗎:
<build>
<resources>
<resource>
<directory>src/main/config</directory>
</resource>
</resources>
</build>
我認為您需要像那樣在依賴項中添加 scope
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.