The
Maven management project has been used frequently recently, so summarize the used Maven Pom.xml configuration. The version of Maven I use locally is apache-maven-3.0.3. Engineering for the ordinary Java application into a jar package form deployment, Web engineering configuration will be briefly introduced later.
First, basic configuration XML code <!-- pom.xml file with Project as root node --> <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" > <!-- Declaration pom.xml file supported version -- > <modelVersion>4.0.0</modelVersion> <!-- Global Project Unique identification, usually using fully qualified Baonilai and other projects to differentiate --> < groupid>front</groupid> <!-- The only product identification within a given groupId is also the output of the project name --> <artifactId>front</artifactId> <!-- Current version of Artifactid for this project's output --> <version>1.0< /version> <!-- Output type: jar, war, ear... --> <packaging>jar</packaging>
Second, build configuration XML code <!-- Project local build file list, you can change the file construction process --> < profiles> <profile> <!-- Development environment Configuration --> <id>dev</id> <!-- Default execution development environment configuration --> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <!-- Each property configuration, use ${} in the configuration file directly --> <log.level>TRACE</log.level> <!-- ... --> </properties> </profile> <profile> <!-- On-line environment configuration --> <id >prod</id> < properties> <log.level>debug</log.level> <!-- ... --> </properties> </profile> </profiles> How to use: mvn clean Package-pdev or- Pprod (perform different build configurations) for packaging.
For more information, see my other blog:
Engineering configuration management combined with Commons configuration and Maven http://shensy.iteye.com/blog/1747408
Third, constant XML code <!--define constants, and--> <properties> <project.build.sourceencoding>utf-can be used elsewhere in the project 8</project.build.sourceencoding> <!--...--> </properties>
Iv. Dependency Management XML code <!--all dependencies list for this project--> <dependencies> <dependency>