IntelliJ IDEA import and reimport a project

一下是import一個Maven project的時候需要進行的配置:

(1)Keep projects files in: 
通過這一個check box來指定“項目文件”在導入之後的location。
比如說,當你import一個project並希望將“.iml”文件和“.idea”文件夾導入到指定的文件夾中,而不是默認的位置。
默認地,IntellJ IDEA會將“項目文件”放在pom.xml的旁邊。



(2)Import Maven projects automatically:
選擇該項,如果你想要每次你修改你的pom.xml文件時,IntelliJ IDEA都會自動執行reimport。


(3)Create IntelliJ IDEA modules for aggregator projects (with 'pom' packaging):
選擇該項,在該“aggressive project”的pom.xml中的包含的每一個Maven Modules將會被創建。


(4)Create module groups for multi-module Maven projects:
選擇該項,IntelliJ IDEA將會根據該aggressive Maven project創建一個module group,包含每個nested modules。


(5)Keep source and test folders on reimport:
1.選擇該項,所有的“source”和“test”文件夾將會在每次import時被保存。
2.不選該項,所有之前配置的“source”和“test”文件夾將會在每次import的時候被remove掉。
默認地,該check box如下設置的:
1.對於new project:不選該項;
2.對於already imported projects:選擇該項。


(6)Exclude build directory (PROJECT_ROOT/target):
選擇該項,來從該項目中排出build目錄。
這個可能會有用,如果你想要加速項目導入的進程。
不選該項,IntelliJ IDEA在每次你import一個project的時候,將會在build目錄下的文件建立索引,這樣的話有可能會有額外的時間開銷。



(7)Use Maven output directories:
不選該項,build將會被創建在IntelliJ IDEA的默認output目錄:USER_HOME\IdeaProjects\<project>\classes\Production\;
選擇該項,build被創建在Mavende output目錄,而且,IntelliJ IDEA編譯的結果被reused。
但是,IntelliJ IDEA本身不會reuse Maven build的結果,and,會重頭編譯。



(8)Generated sources folders:
當你reimport一個project的時候,指定你的source root的directory。
你可以選擇這下面的一種選項:
1.Detect automatically: 這是默認選項。IntelliJ IDEA將自動的識別產生sources的位置。
IntelliJ IDEA也會識別標記爲source root的路徑。但是,IntelliJ IDEA只在target/generated-sources和target/generated-sources/*下搜索。
2.target/generated-sources:這個選項讓你手動的標記source root。
3.subdirectories of "target/generated-sources":這個選項讓你手動的標記subdirectory爲source root。
4.Don't detect:這個選項讓你跳過detection process。



(9)Phase to be used for folders update:
選擇用來folder updat的Maven phase。這可能有用,如果你調整你的plugins,爲了使額外的sources在某些階段被load進來。


(10)Automatically download:
選擇source、documenation,在一個opening Maven project中,這些將會被自動下載。


(11)Dependency types:
使用這個field來指定,當你reimport project時候的dependency types。


(12)Use Maven3 to import a project:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章