Maven中pom.xml解析
阿新 • • 發佈:2018-11-07
pom.xml常用元素 modelVersion 指定了當前pom版本 groupId 反寫的公司網址+專案名 artifactId 專案名+模組名 version 版本號 第一個0表示大版本號;第二個0表示分支版本號;第三個0表示小版本號;如:0.0.1SNAPSHOT快照(snapshot:快照;alpha:內部測試;beta:公測;Release:穩定;GA:正式釋出)
packaging 打包方式 預設是jar
<name>專案的描述名</name> <url>專案的地址</url> <description>專案描述</description> <developers>開發人員資訊</developers> <licenses>許可證資訊</licenses> <!-- 依賴列表 --> <dependencies> <!-- 依賴項 --> <dependency> <groupId></groupId> <artifactId></artifactId> <version></version> <type></type> <scope>依賴的範圍</scope> <optional>設定依賴是否可選,預設是false</optional> <!-- 排除依賴傳遞列表 --> <exclusions> <exclusion></exclusion> </exclusions> </dependency> </dependencies> <!-- 依賴的管理,一般定義在父模組中,由子模組去繼承 --> <dependencyManagement> <dependencies> <dependency></dependency> </dependencies> </dependencyManagement> <!-- 對構建行為提供相應的支援 --> <build> <!-- 外掛列表 --> <plugins> <plugin> <!-- 指定座標 --> <groupId></groupId> <artifactId></artifactId> <version></version> </plugin> </plugins> </build> <!-- 一般在子模組中指定所繼承的父模組 --> <parent></parent> <!-- 模組列表 --> <modules> <module></module> </modules>