MAVEN Project Management configuration

Source: Internet
Author: User

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>

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.