<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation=
                 "http://maven.apache.org/POM/4.0.0
                  http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>**</groupId>
    <artifactId>**</artifactId>
    <packaging>pom</packaging>
    <version>1.0</version>

    <modules>
        <module>**</module>
        <module>**</module>
    </modules>

    <description>**</description>

    <properties>
        <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
        <jdk.version>1.8</jdk.version>
        <slf4j.api.version>1.7.14</slf4j.api.version>
        <log4j.slf4j.impl.version>2.5</log4j.slf4j.impl.version>
        <log4j.core.version>2.5</log4j.core.version>
        <junit.version>4.12</junit.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <compilerVersion>${jdk.version}</compilerVersion>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>test</id>
            <properties>
                <build.profile>test</build.profile>
                <host.nexus.central>
                    http://host:port/nexus/content/repositories/central
                </host.nexus.central>
                <host.nexus.release>
                    http://host:port/nexus/content/repositories/releases
                </host.nexus.release>
                <host.nexus.public>
                    http://host:port/nexus/content/repositories/public
                </host.nexus.public>
                <host.nexus.snapshots>
                    http://host:port/nexus/content/repositories/snapshots
                </host.nexus.snapshots>
            </properties>
            <build>
                <filters>
                    <filter>src/profiles/${build.profile}/config.properties</filter>
                </filters>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
            </build>
        </profile>

        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <build.profile>dev</build.profile>
                <host.nexus.central>
                    http://host:port/nexus/content/repositories/central
                </host.nexus.central>
                <host.nexus.release>
                    http://host:port/nexus/content/repositories/releases
                </host.nexus.release>
                <host.nexus.public>
                    http://host:port/nexus/content/repositories/public
                </host.nexus.public>
                <host.nexus.snapshots>
                    http://host:port/nexus/content/repositories/snapshots
                </host.nexus.snapshots>
            </properties>
            <build>
                <filters>
                    <filter>src/profiles/${build.profile}/config.properties</filter>
                </filters>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
            </build>
        </profile>

        <profile>
            <id>prod</id>
            <properties>
                <build.profile>prod</build.profile>
                <host.nexus.central>
                    http://host:port/nexus/content/repositories/central
                </host.nexus.central>
                <host.nexus.release>
                    http://host:port/nexus/content/repositories/releases
                </host.nexus.release>
                <host.nexus.public>
                    http://host:port/nexus/content/repositories/public
                </host.nexus.public>
                <host.nexus.snapshots>
                    http://host:port/nexus/content/repositories/snapshots
                </host.nexus.snapshots>
            </properties>
            <build>
                <filters>
                    <filter>src/profiles/${build.profile}/config.properties</filter>
                </filters>
                <resources>
                    <resource>
                        <directory>src/main/resources</directory>
                        <filtering>true</filtering>
                    </resource>
                </resources>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>nexus-central</id>
            <name>nexus central</name>
            <url>${host.nexus.central}</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>

        <repository>
            <id>nexus-release</id>
            <name>nexus release</name>
            <url>${host.nexus.release}</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>

        <repository>
            <id>nexus-snapshots</id>
            <name>nexus snapshots</name>
            <url>${host.nexus.snapshots}</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.api.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j.slf4j.impl.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.core.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>

内置属性(Maven预定义可以直接使用)

${basedir} 项目根目录 

${version}表示项目版本;

${project.basedir}同${basedir};

${project.version}表示项目版本,与${version}相同;

${project.build.directory} 构建目录,缺省为target

${project.build.sourceEncoding}表示主源码的编码格式;

${project.build.sourceDirectory}表示主源码路径;

${project.build.finalName}表示输出文件名称;

${project.build.outputDirectory} 构建过程输出目录,缺省为target/classes

pom.xml 样例的更多相关文章

  1. maven的pom.xml样例

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  2. java使用xsd校验xml样例

    知识点:XSD文件是指XML结构定义 ( XML Schemas Definition )文件,是DTD的替代品.可以用一个指定的XML Schema来验证某个XML文档,以检查该XML文档是否符合其 ...

  3. Solr 6.7学习笔记(02)-- 配置文件 managed-schema (schema.xml) -- 样例(6)

    managed-schema 样例: <?xml version="1.0" encoding="UTF-8" ?> <!-- License ...

  4. BOOST 解析,修改,生成xml样例

    解析XML 解析iworld XML,拿到entity和VisibleVolume的数据 int ParseiWorlds::readXML(const bpath &dir) { ptree ...

  5. settings.xml样例文件

    localRepository G:\program-my\maven-responsery true --> false --> com.your.plugins --> prox ...

  6. Funambol Developer&#39;s Guide 中 connector development样例的问题

    今天学习Funambol的connector开发,官方文档中的样例有问题. 首先,文档中提供的maven命令不可用: mvn archetype:generate -DarchetypeGroupId ...

  7. Java连接redis的使用演示样例

    Java连接redis的使用演示样例 Redis是开源的key-value存储工具,redis通经常使用来存储结构化的数据,由于redis的key能够包括String.hash.listset和sor ...

  8. maven pom.xml具体解释(整理)

    pom作为项目对象模型. 通过xml表示maven项目,使用pom.xml来实现.主要描写叙述了项目:包含配置文件.开发人员须要遵循的规则,缺陷管理系统.组织和licenses,项目的url,项目的依 ...

  9. 【MAVEN】maven系列--pom.xml标签详解

    pom文件作为MAVEN中重要的配置文件,对于它的配置是相当重要.文件中包含了开发者需遵循的规则.缺陷管理系统.组织.licenses.项目信息.项目依赖性等.下面将重点介绍一下该文件的基本组成与功能 ...

随机推荐

  1. Type mismatch: cannot convert from java.sql.PreparedStatement to com.mysql.jdbc.PreparedStatement

    Connection.prepareStatement()函数出错,提示: Type mismatch: cannot convert from java.sql.PreparedStatement ...

  2. Hack语言的类型系统

    基础类型 PHP中主要的基础类型可以在Hack中进行显式类型标注.包含: bool int float string array resource <?hh namespace Hack\Use ...

  3. 泛函编程(32)-泛函IO:IO Monad

    由于泛函编程非常重视函数组合(function composition),任何带有副作用(side effect)的函数都无法实现函数组合,所以必须把包含外界影响(effectful)副作用不纯代码( ...

  4. EntityFramework动态多条件查询与Lambda表达式树

              在常规的信息系统中, 我们有需要动态多条件查询的情况, 例如UI上有多个选择项可供用户选择多条件查询数据. 那么在.net平台Entity Framework下, 我们用Lambd ...

  5. Insight API开源项目介绍

           首先,在阅读本文以前假设您已经了解比特币Bitcoin基本原理. Insight API是一个开源基于比特币Bitcoin  blockchain的REST风格的API框架.Insigh ...

  6. CAS客户端服务器端配置步骤

    来自我的个人网站:http://lkf.22web.org/ cas介绍: CAS 是 Yale 大学发起的一个开源项目,旨在为 Web 应用系统提供一种可靠的单点登录方法,CAS 在 2004 年 ...

  7. nginx 在ubuntu 上的启动,停止,重启

    vi 显示行号 :set num 在开始玩nginx之前,得先安装nginx,可以参考 <ubuntu15.10_x64 安装 nginx>   启动 sudo /usr/local/ng ...

  8. 基于 jQuery 实现的精致作品集图片导航效果

    今天,我们要用 jQuery 来创建一个作品集图像的导航模板.我们的想法是,以分组的方式显示一组作品集,并通过二维的方式(水平/垂直)来浏览.任一箭头或当前图像下方的小盒子可以作为导航使用. 在线演示 ...

  9. Web 开发中应用 HTML5 技术的10个实例教程

    HTML5 作为下一代网站开发技术,无论你是一个 Web 开发人员或者想探索新的平台的游戏开发者,都值得去研究.借助尖端功能,技术和 API,HTML5 允许你创建响应性.创新性.互动性以及令人惊叹的 ...

  10. 精通 CSS 选择器

    CSS 选择器除了样式表匹配元素时需要用到,在使用 jQuery 等库的时候也可以利用 CSS 选择器来选择元素,因此作为前端开发需要熟练掌握.下面是一些常用的 CSS 选择器示例. 元素选择器 E, ...