Maven Pom.xml Basic Usage

Source: Internet
Author: User

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}--> &LT;properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!--spri Ng version number-<spring.version>4.1.1.RELEASE</spring.version> <!--mybatis Version number--&LT ;mybatis.version>3.2.6</mybatis.version> <!--log4j log file Management Pack version--&LT;SLF4J.VERSION&GT;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&lt ;/artifactid> <!--dependent version number--<version>${spring.version}</version> </d Ependency> </dependencies> <!--generate the name of the war package---<build> <finalname>game&lt ;/finalname> &Lt;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&lt ;/target> </configuration> </plugin> </plugins> </buil D> <!--project Name--<name> game Management </name> <!--project Description--<description> game server Platform Management, game Association &LT ;/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> &lt                ;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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.