Maven的pom.xml簡單介紹

Maven是一個項目管理工具,是基於項目對象模型的概念運做的。Maven的項目都有一個pom.xml文件用來管理項目的依賴以及編譯等功能。java

下面詳細介紹一下各個配置元素的功能mysql

  1. dependencies元素 ,這個元素包含了多個須要的項目依賴 例如: org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test 2.1.5.RELEASE mysql mysql-connector-java web

  2. dependency元素 內部經過groupId、artifactId以及version這三個座標肯定惟一的依賴。 groupId : 組織的惟一標識 artifactId : 項目的惟一標識 verson : 項目的版本spring

  3. 變量定義 可定義變量在dependency中的引用 例如: <web.version>1.8</web.version> org.springframework.boot spring-boot-starter-web ${web.version} sql

  4. 編譯插件 引入編譯插件 org.springframework.boot spring-boot-maven-plugin true maven

  5. Maven的運做方式 Maven會自動根據dependency中的依賴配置,直接經過互聯網在Maven中心庫下載相關依賴包到.m2的目錄下,.m2目錄下是你本地Maven庫。spring-boot

相關文章
相關標籤/搜索