擁有一個通用的目錄佈局能夠讓開發人員在不一樣的Maven項目中都產生一種熟悉的感受.接下來的內容記載了Maven指望的目錄佈局,而Maven自己建立的結構也是這樣的.請儘量的符合這個結構.然而,不過你不能這麼作,這些設置也是能夠被不一樣的項目描述重寫的.java
src/main/java | Application/Library sources |
src/main/resources | Application/Library resources |
src/main/resources-filtered | Application/Library resources which are filtered. (Starting with Maven 3.4.0, not yet released.) |
src/main/filters | Resource filter files |
src/main/webapp | Web application sources |
src/test/java | Test sources |
src/test/resources | Test resources |
src/test/resources-filtered | Test resources which are filtered by default. (Starting with Maven 3.4.0, not yet released.) |
src/test/filters | Test resource filter files |
src/it | Integration Tests (primarily for plugins) |
src/assembly | Assembly descriptors |
src/site | Site |
LICENSE.txt | Project's license |
NOTICE.txt | Notices and attributions required by libraries that the project depends on |
README.txt | Project's readme |
在項目文件描述的最頂層:除了有pom.xml以外,還有一些能夠被用戶直接閱讀的文本文檔,如: README.txt , LICENSE.txt 等.git
在這個結構中只有兩個子目錄:src和target.除此以外只但願存在的其餘目錄是元數據(像:CVS,.git或.svn)和一個子項目目錄(每一個子項目自己的結構又和上面所描述的同樣).web
target目錄用來存放全部的構建輸出.app
src目錄則包含全部用於構建項目及它的站點等等的原材料.它爲每種類型提供了一個子目錄:main對應主要構建工件,test對應單元測試代碼和資源,還有site等等.webapp
在工件產生源目錄(如main和test)下,這裏有個jave語言目錄(存在常見的包層級結構)和resources目錄(這裏面的內容會被拷貝到默認資源定義指定的目標類路徑classpath下)svn
若是這裏還有其餘爲構建項目做出貢獻的來源,它們將被放置在其餘子目錄:如src/main/antlr應該包含Antlr語法定義文件.佈局