国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

idea maven 項(xiàng)目src下的配置文件沒有同步至target的解決操作

瀏覽:9日期:2024-08-16 16:03:40

如果發(fā)現(xiàn)maven項(xiàng)目里面src/main/resources下的配置文件或src/main/java下的xml配置文件未能同步至target,首先,要確保src下的文件夾職能劃分好,如下圖,請(qǐng)注意java, resources, webapp這些目錄的圖標(biāo),如果不是這樣,請(qǐng)選中后右鍵->make directory as來指明文件夾用途。

idea maven 項(xiàng)目src下的配置文件沒有同步至target的解決操作

在下面這里分別指出web.xml的位置和web root的位置。

idea maven 項(xiàng)目src下的配置文件沒有同步至target的解決操作

這個(gè)編譯后輸出的路徑用默認(rèn)的, 不要改變 。

idea maven 項(xiàng)目src下的配置文件沒有同步至target的解決操作

重點(diǎn)是pom.xml,如果你的pom里面沒有<build>配置參數(shù)就沒問題,如果有,請(qǐng)將下面這些resource的配置參數(shù)加上:

<resources> <resource><directory>src/main/resources</directory><includes> <include>**/*.properties</include> <include>**/*.xml</include> <include>**/*.tld</include> <include>**/*.xls</include> <include>**/*.xlsx</include></includes><filtering>true</filtering> </resource> <resource><directory>src/main/java</directory><includes> <include>**/*.properties</include> <include>**/*.tld</include> <include>**/*.xls</include> <include>**/*.xlsx</include> <include>**/*.xml</include></includes><filtering>true</filtering> </resource> </resources>

完畢后,重新build 這個(gè)module的artifact的exploded,在src下的配置文件就會(huì)同步到target。

補(bǔ)充知識(shí):Idea+maven配置項(xiàng)目resources下的配置文件不被輸出到target的解決方法

用maven配置項(xiàng)目時(shí),resources下的配置文件沒有被輸出到target文件夾下,導(dǎo)致配置文件不生效。

解決方法:在maven的pom.xml配置文件中在resources下添加你的配置文件夾。

<resource> <directory>src/main/resources</directory></resource>

這個(gè)方法是比較通用的解決方法,即使有多個(gè)配置文件夾也可以添加上。

以上這篇idea maven 項(xiàng)目src下的配置文件沒有同步至target的解決操作就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: IDEA
相關(guān)文章:
主站蜘蛛池模板: 永善县| 巫溪县| 彭山县| 新疆| 延津县| 古丈县| 开原市| 泰和县| 江油市| 吴川市| 丰原市| 比如县| 汝城县| 杭锦旗| 墨江| 尼勒克县| 南宁市| 万山特区| 伊宁市| 怀化市| 团风县| 英德市| 廉江市| 临泉县| 武陟县| 临泉县| 奎屯市| 宿迁市| 河津市| 绵阳市| 克山县| 保山市| 通化市| 竹北市| 富锦市| 青神县| 沾益县| 新邵县| 千阳县| 曲靖市| 泌阳县|