maven配置实例

<?xml version="1.0" encoding="UTF-8"?>
<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">

<modelVersion>4.0.0</modelVersion>
<groupId>com.bigao.baihua</groupId>
<artifactId>baihua-portal</artifactId>
<version>1.1.0</version>
<packaging>pom</packaging>
<name>baihua-portal</name>


<modules>
<module>../baihua-common</module>
<module>../baihua-api</module>
<module>../baihua-mng</module>
<module>../baihua-cpweb</module>
<module>../baihua-sms</module>
</modules>




<properties>
<!-- 主要依赖库的版本定义 -->
<springside.version>4.2.3-GA</springside.version>
<spring.version>4.1.7.RELEASE</spring.version>
<jarlun.framework.version>1.2.0</jarlun.framework.version>

<!-- 测试相关的依赖库版本 -->
<junit.version>4.11</junit.version>
<assertj.version>1.6.1</assertj.version>
<jetty.version>8.1.16.v20140903</jetty.version>

<!-- Plugin的属性 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.7</jdk.version>
</properties>

<dependencies>
<dependency>
<groupId>jarlun.framework</groupId>
<artifactId>framework-core</artifactId>
<version>${jarlun.framework.version}</version>
</dependency>

<!-- mybattis 的分页处理类 -->
<dependency>
   <groupId>com.github.pagehelper</groupId>
   <artifactId>pagehelper</artifactId>
   <version>4.0.0</version>
</dependency>


<!-- servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
</dependency>

<!-- TEST begin -->
<dependency>
<groupId>org.springside</groupId>
<artifactId>springside-core</artifactId>
<version>${springside.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springside</groupId>
<artifactId>springside-extension</artifactId>
<version>${springside.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>


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

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>


<!-- jetty -->
<dependency>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>jetty-webapp</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>

<!-- httpserver -->
<dependency>
            <groupId>com.squareup.okhttp</groupId>
            <artifactId>mockwebserver</artifactId>
            <version>1.5.4</version>
            <scope>test</scope>
        </dependency>
        
        <!-- mail server simulator -->
<dependency>
<groupId>com.icegreen</groupId>
<artifactId>greenmail</artifactId>
<version>1.3.1b</version>
<scope>test</scope>
</dependency>

<dependency>  
            <groupId>javax.el</groupId>  
            <artifactId>el-api</artifactId>  
            <version>1.0</version> 
<scope>test</scope> 
        </dependency>
<!-- TEST end -->

</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.6.9</version>
</dependency>
<!-- 中文转拼音 -->
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.0</version>
</dependency>

</dependencies>
</dependencyManagement>

<build>
<plugins>
<!-- source attach plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.3</version>
<configuration>
        <finalName>${project.name}-${project.version}</finalName>
       </configuration>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- compiler插件, 设定JDK版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
                <encoding>${project.build.sourceEncoding}</encoding> 
<showWarnings>true</showWarnings>
</configuration>
</plugin>


<!-- war打包插件, 设定war包名称带版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.5</version>
<configuration>
<warName>${project.name}-${project.version}</warName>
<packagingExcludes>
<!-- 
WEB-INF/lib/*.jar,
-->
WEB-INF/classes/app.properties,
WEB-INF/classes/logback.xml,
WEB-INF/classes/emchat.properties  
</packagingExcludes>
<archive>
           <manifest>
            <addClasspath>true</addClasspath>
           </manifest>
       </archive>
</configuration>
</plugin>


<!-- test插件, 仅测试名称为*Test的类,使用支持分组测试的surefire-junit47 driver -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18</version>
<configuration>
               <forkMode>once</forkMode> 
               <argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine> 
<includes>
<include>**/*Test.java</include>
</includes>
<excludes>
<exclude>**/controller/*.java</exclude>
<exclude>**/test/*.java</exclude>
</excludes>
<argLine>-Xmx256M</argLine>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.18</version>
</dependency>
</dependencies>
</plugin>


<!-- cobertura插件, 设置不需要计算覆盖率的类 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<instrumentation>
<excludes>
<exclude>**/entity/**/*.class</exclude>
<exclude>**/*Controller.class</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>


<!-- jetty插件, 设定context path与spring profile -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<systemProperties>
<systemProperty>
<name>spring.profiles.active</name>
<value>development</value>
</systemProperty>
</systemProperties>
<useTestClasspath>true</useTestClasspath>


<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
</webAppConfig>
</configuration>
</plugin>


<!-- resources插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
                <encoding>${project.build.sourceEncoding}</encoding> 
</configuration>
</plugin>


<!-- install插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<configuration>
                <encoding>${project.build.sourceEncoding}</encoding> 
</configuration>
</plugin>


<!-- jar打包插件, 设定jar包名称带版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<jarName>${project.name}-${project.version}</jarName>
</configuration>
</plugin>

<!-- ant插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
</plugin>
</plugins>
</build>

</project>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值