|
@@ -0,0 +1,86 @@
|
|
|
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
|
+ <modelVersion>4.0.0</modelVersion>
|
|
|
+
|
|
|
+ <!-- 在maven管理jar包时 是通过 groupId artifactId version-->
|
|
|
+ <!-- 在创建一个maven项目时 也需要定义三要素 是因为当前项目也可以打包成jar 提供给别的项目使用-->
|
|
|
+ <groupId>com.sf</groupId>
|
|
|
+ <artifactId>maven-demo</artifactId>
|
|
|
+ <version>1.0-SNAPSHOT</version>
|
|
|
+ <!-- 打包方式 -->
|
|
|
+ <packaging>pom</packaging>
|
|
|
+
|
|
|
+ <!-- 对应到maven栏中的名字 -->
|
|
|
+ <name>maven-demo</name>
|
|
|
+ <!-- maven官方路径 apache是一个软件基金会 a patchy server 补丁服务-->
|
|
|
+ <!-- maven 是自动化构建工具-->
|
|
|
+ <!-- 构建: 是将工程编译得到的结果部署到服务器上的过程 -->
|
|
|
+ <url>http://maven.apache.org</url>
|
|
|
+
|
|
|
+ <!-- 在添加模块后 会在父项目的url下 增加模块列表 -->
|
|
|
+ <modules>
|
|
|
+ <!-- 具体模块名 -->
|
|
|
+ <module>sub-demo</module>
|
|
|
+ <module>sub1-demo</module>
|
|
|
+ </modules>
|
|
|
+
|
|
|
+ <!-- 配置 帮我们统一管理版本号 -->
|
|
|
+ <properties>
|
|
|
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
|
+ <spring.version>6.1.12</spring.version>
|
|
|
+ </properties>
|
|
|
+
|
|
|
+ <!--dependencies 意思是依赖列表 -->
|
|
|
+ <!--dependencyManagement 可以让父项目的依赖 不会被子项目自动引入 -->
|
|
|
+ <!-- 同时在子项目明确引入依赖时 可以复用这里的版本 -->
|
|
|
+ <dependencyManagement>
|
|
|
+ <dependencies>
|
|
|
+ <dependency>
|
|
|
+ <!-- 查看引入依赖的地址 以配置的maven仓库为起始地址 + groupId + artifactId + version + jar包名(artifactId + version) -->
|
|
|
+ <!-- /Users/Qing/.m2/repository/com/google/code/gson/gson/2.11.0/gson-2.11.0.jar -->
|
|
|
+ <groupId>com.google.code.gson</groupId>
|
|
|
+ <artifactId>gson</artifactId>
|
|
|
+ <version>2.11.0</version>
|
|
|
+ </dependency>
|
|
|
+ <!-- 这里是可以存放多个依赖的 -->
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.junit.jupiter</groupId>
|
|
|
+ <artifactId>junit-jupiter</artifactId>
|
|
|
+ <version>5.11.0</version>
|
|
|
+ </dependency>
|
|
|
+
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.springframework</groupId>
|
|
|
+ <artifactId>spring-context</artifactId>
|
|
|
+ <!-- 使用$+大括号来指代变量 通过变量名找到变量值 -->
|
|
|
+ <version>${spring.version}</version>
|
|
|
+ </dependency>
|
|
|
+
|
|
|
+ <dependency>
|
|
|
+ <groupId>org.springframework</groupId>
|
|
|
+ <artifactId>spring-aop</artifactId>
|
|
|
+ <version>${spring.version}</version>
|
|
|
+ </dependency>
|
|
|
+
|
|
|
+ </dependencies>
|
|
|
+ </dependencyManagement>
|
|
|
+
|
|
|
+ <!-- 对编译进行配置 -->
|
|
|
+ <build>
|
|
|
+ <!-- 插件列表 -->
|
|
|
+ <plugins>
|
|
|
+ <!-- 单个插件的配置 -->
|
|
|
+ <plugin>
|
|
|
+ <!-- 也是通过三要素找到插件 -->
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
+ <artifactId>maven-compiler-plugin</artifactId>
|
|
|
+ <version>3.11.0</version>
|
|
|
+ <!-- 对插件的使用进行配置 -->
|
|
|
+ <configuration>
|
|
|
+ <source>17</source>
|
|
|
+ <target>17</target>
|
|
|
+ </configuration>
|
|
|
+ </plugin>
|
|
|
+ </plugins>
|
|
|
+ </build>
|
|
|
+</project>
|