2022.4.23 pom文件
pom文件
pom.xml是Maven的核心配置文件


1 <?xml version="1.0" encoding="UTF-8"?> 2 3 <!--maven版本和头文件--> 4 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 5 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 6 <modelVersion>4.0.0</modelVersion> 7 8 <!--这里就是我们刚刚配置的GAV(groupId,artifactId,version)--> 9 <groupId>com.xing</groupId> 10 <artifactId>javaweb-01-maven</artifactId> 11 <version>1.0-SNAPSHOT</version> 12 13 <!--Package :项目的打包方式 14 jar: java应用 15 war: Javaweb应用 16 --> 17 <packaging>war</packaging> 18 19 20 <name>javaweb-01-maven Maven Webapp</name> 21 <!-- FIXME change it to the project's website --> 22 <url>http://www.example.com</url> 23 24 <!-- 配置--> 25 <properties> 26 <!-- 项目的默认构建编码--> 27 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 28 <!-- 编译版本--> 29 <maven.compiler.source>1.7</maven.compiler.source> 30 <maven.compiler.target>1.7</maven.compiler.target> 31 </properties> 32 33 <!-- 项目依赖--> 34 <dependencies> 35 <!-- 具体依赖的jar包配置文件--> 36 <dependency> 37 <groupId>junit</groupId> 38 <artifactId>junit</artifactId> 39 <version>4.11</version> 40 <scope>test</scope> 41 </dependency> 42 </dependencies> 43 44 <!--项目构建用的东西--> 45 <build> 46 <finalName>javaweb-01-maven</finalName> 47 <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> 48 <plugins> 49 <plugin> 50 <artifactId>maven-clean-plugin</artifactId> 51 <version>3.1.0</version> 52 </plugin> 53 <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --> 54 <plugin> 55 <artifactId>maven-resources-plugin</artifactId> 56 <version>3.0.2</version> 57 </plugin> 58 <plugin> 59 <artifactId>maven-compiler-plugin</artifactId> 60 <version>3.8.0</version> 61 </plugin> 62 <plugin> 63 <artifactId>maven-surefire-plugin</artifactId> 64 <version>2.22.1</version> 65 </plugin> 66 <plugin> 67 <artifactId>maven-war-plugin</artifactId> 68 <version>3.2.2</version> 69 </plugin> 70 <plugin> 71 <artifactId>maven-install-plugin</artifactId> 72 <version>2.5.2</version> 73 </plugin> 74 <plugin> 75 <artifactId>maven-deploy-plugin</artifactId> 76 <version>2.8.2</version> 77 </plugin> 78 </plugins> 79 </pluginManagement> 80 </build> 81 </project>
