如何在ideal中更改module的名字

ideal中修改module和directoryhtml

如何在ideal中修改module的名字。 平時在建立項目的的時候 ,偶爾會根據業務需求或者心情需求,來更改下module的名字。maven

更改的時候 要注意。ide

1.先改pom.xml中的artifactId的名字idea

 <artifactId>hcb_common</artifactId>

2.再shift+f6 理改module和directore的名字,不要勾選reference相關。spa

3.更改父項目中module的名字3d

好比要把common改成hcb_common,orm

image-20210329233751110

選中common 按shirt+f6彈出的對話框選擇 rename module and directoryxml

image-20210329233901462

輸入要更改的名字,先不要打勾search for references and search in comments and strings .htm

image-20210329234000026

若是更改完之後,出現以下提示blog


則表示 module更改爲功了,可是directory還沒成功 。 https://yyk.fh21.com.cn/hospital_7942/tsyl.html

繼續shift +f6更改directory ,若是仍是不成功的話。 打開該module在資源管理器中的位置,直接在資源管理中更改

image-20210329234256095

改完之後回到ideal中,自動的module會變回新的名字

image-20210329234356935

而後再把父項目的pom.xml中引用的module名字變動一下


同時記得修改module中pom.xml中的artifactid ,不然會出現以下顯示 ,

com.hcb.common是最原始的一個名字。

image-20210329234725833

一樣的右邊的maven也是顯示com.hcb.common

image-20210329234805278

更改完之後,若是module仍是顯示 有原來的名字,則從新更改下module .

就能夠了。