The Pom.xml file is the primary configuration file that Maven works on. In this file we can configure the elements required for MAVEN projects such as GroupID, Artifactid, and version of the MAVEN project; You can configure the remote warehouse that MAVEN projects need to use, and you can define the form of MAVEN project packaging , you can define resource dependencies for MAVEN projects, and so on. The definition of one of the simplest pom.xml must contain the four elements of Modelversion, GroupId, Artifactid, and version, of course, which can also inherit from its parent project. In Maven, a single project is uniquely identified using the form of GroupID, Artifactid, and version groupdId:artifactId:version.
<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi:s chemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" > <!-- Specifies the version of the current pom-<modelVersion>4.0.0</modelVersion> <!--Project ID, which is a large id--> of the entire product <groupid>game Servertxxs</groupid> <!--Project ID, is the product ID for this small project, one module of the actual project--<artifactid>gameserver.txxs</ Artifactid> <!--version number--<version>1.0</version> <!--packaging mechanisms such as POM, jar, Maven-plugin, EJB, war , ear, RAR, par, default is jar--> <packaging>war</packaging> <!--find dependent and extended remote warehouse list. -<repositories> <!--contains information that needs to be connected to the remote warehouse--<repository> <id>java.net </id> <url>http://download.java.net/maven/2/</url> </repository> </reposit Ories> <!--properties, define constants that are referenced directly elsewhere in the Pom, so reference ${spring.version}--> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!--spri Ng version number-<spring.version>4.1.1.RELEASE</spring.version> <!--mybatis Version number--< ;mybatis.version>3.2.6</mybatis.version> <!--log4j log file Management Pack version--<SLF4J.VERSION>1.7.7&L T;/slf4j.version> <log4j.version>1.2.17</log4j.version> </properties> <!--dependency list here are some Three-party dependency pack-<dependencies> <dependency> <!--dependent Group Id--> <groupid& Gt;org.springframework</groupid> <!--dependent artifact id--> <artifactid>spring-core< ;/artifactid> <!--dependent version number--<version>${spring.version}</version> </d Ependency> </dependencies> <!--generate the name of the war package---<build> <finalname>game< ;/finalname> ≪plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6< ;/target> </configuration> </plugin> </plugins> </buil D> <!--project Name--<name> game Management </name> <!--project Description--<description> game server Platform Management, game Association < ;/description> <!--Projects--<url>http://www.txxs.com/game</url> <!--founding year--<inc Eptionyear>2015</inceptionyear> <!--configuration Developer information: A developer can have multiple roles, properties--<developers> <devel oper> <id>txxs</id> <name>jiang huimin</name> <email> @tx Xs.com</email> <!--project Developer's homepage--<url>http://www.txxs.com</url> <organization>buaas Oft</organization> <organizationUrl>http://soft.buaa.edu.cn/</organizationUrl> < ;roles> <role>project</role> <role>architect</role> <role>developer</role> <role>tester</role> </roles> & Lt;timezone>+8</timezone> <properties> <picurl>http://txxs.com/tmlk/avatar/ user/1/fb0de1dd1fae499ebd5531c8509b4b07</picurl> </properties> </developer> </de Velopers> <!--bug Tracking management System-<issueManagement> <system>Redmine</system> <u Rl>http://redmine.txxs.com/</url> </issueManagement></project>
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Maven Pom.xml Basic Usage