maven pom.xml配置讲解

<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.study.owls</groupId>
    <artifactId>owls-mobile</artifactId>
    <version>2.1.01-SNAPSHOT</version>
    <packaging>war</packaging>
    
    <name>owls-mobile</name>
    <description>OWLS 2.1.01 for JK Mobile.</description>


    <organization>
        <name>Study</name>
        <url>http://www.sina.com</url>
    </organization>


    <developers>
        <developer>
            <id>ok</id>
            <name>111</name>
            <email>zhang@qq..com</email>
            <organization>Study</organization>
            <roles>
                <role>PL</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>


  <!--  <modules>
        <module>owls-uic</module>
        <module>owls-msc</module>
        <module>owls-common</module>
        <module>owls-gis</module>
        <module>owls-query</module>
        <module>owls-analysis</module>
        <module>owls-workflow</module>
    </modules>-->


    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jdk.version>1.6</jdk.version>


        <owls-utils.version>1.3.06-SNAPSHOT</owls-utils.version>
        <lucene.version>3.6.0</lucene.version>
        <solr.version>1.4.1</solr.version>
        <druid.version>0.2.25</druid.version>
        <spring.version>3.2.0.RELEASE</spring.version>
        <hibernate.version>4.1.8.Final</hibernate.version>
        <shiro.version>1.2.1</shiro.version>
        <freemarker.version>2.3.19</freemarker.version>
        <hibernate-validator.version>4.3.1.Final</hibernate-validator.version>
        <jackson.version>2.1.2</jackson.version>
        <slf4j.version>1.7.1</slf4j.version>
        <log4j.version>1.2.17</log4j.version>
        <commons-lang3.version>3.1</commons-lang3.version>
        <jetty.version>7.6.8.v20121106</jetty.version>
        <activemq.version>5.7.0</activemq.version>
        <ehcache.version>2.6.2</ehcache.version>
        <guava.version>13.0.1</guava.version>
        <jdbc.driver.groupId>ojdbc6</jdbc.driver.groupId>
        <jdbc.driver.artifactId>ojdbc6</jdbc.driver.artifactId>
        <jdbc.driver.version>1.0</jdbc.driver.version>
    </properties>


    <dependencies>
        <!-- using TestNG instead of junit -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8.5</version>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
            <scope>test</scope>
        </dependency>


        <!-- ZTEsec begin -->
        <dependency>
            <groupId>com.ztesec.owls.common</groupId>
            <artifactId>utils</artifactId>
            <version>${owls-utils.version}</version>
        </dependency>




        <dependency>
            <groupId>com.ztesec.protocol</groupId>
            <artifactId>winntcp</artifactId>
            <version>1.1-SNAPSHOT</version>
        </dependency>


        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
            <version>3.6.0.Final</version>
        </dependency>




        <!-- FULL TEXT begin -->
        <!-- lucene -->
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
            <version>${lucene.version}</version>
            <exclusions>


                <exclusion>
                    <groupId>org.apache.lucene</groupId>
                    <artifactId>lucene-misc</artifactId>
                </exclusion>


                <exclusion>
                    <groupId>org.apache.lucene</groupId>
                    <artifactId>lucene-snowball</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.lucene</groupId>
                    <artifactId>lucene-spellchecker</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-highlighter</artifactId>
            <version>${lucene.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.lucene</groupId>
                    <artifactId>lucene-memory</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.lucene</groupId>
                    <artifactId>lucene-queries</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-analyzers</artifactId>
            <version>${lucene.version}</version>
        </dependency>


        <!-- solr -->
        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-core</artifactId>
            <version>${solr.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.solr</groupId>
                    <artifactId>solr-commons-csv</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <dependency>
            <groupId>org.apache.solr</groupId>
            <artifactId>solr-solrj</artifactId>
            <version>${solr.version}</version>
        </dependency>


        <!-- qsp -->
        <dependency>
            <groupId>com.zte</groupId>
            <artifactId>qsp</artifactId>
            <version>1.2.1</version>
        </dependency>


        <dependency>
            <groupId>com.zte</groupId>
            <artifactId>qsp2</artifactId>
            <version>1.0</version>
        </dependency>


        <dependency>
            <groupId>com.zte</groupId>
            <artifactId>MR</artifactId>
            <version>1.02.02</version>
        </dependency>


        <!-- IK 分词器 http://code.google.com/p/ik-analyzer/ -->
        <dependency>
            <groupId>org.wltea.analyzer</groupId>
            <artifactId>ik-analyzer</artifactId>
            <version>3.2.8</version>
        </dependency>






        <!-- FULL TEXT end -->




        <!-- ZTEsec end -->




        <!-- AOP begin -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.7.0</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.7.0</version>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>2.2.2</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>asm</groupId>
            <artifactId>asm</artifactId>
            <version>3.3.1</version>
            <scope>runtime</scope>
        </dependency>
        <!-- AOP end -->


        <!-- SPRING begin -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>




       <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
            <scope>test</scope>
        </dependency>


        <!-- SPRING end -->


        <!-- PERSISTENCE begin -->
        <!-- hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-ehcache</artifactId>
            <version>${hibernate.version}</version>
        </dependency>




        <!-- jobs data access -->
        <!-- <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-jpa</artifactId>
                <version>1.2.0.RELEASE</version>
                <exclusions>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit-dep</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>-->




        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <!-- connection pool -->
        <!-- druid pool -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>${druid.version}</version>
        </dependency>




        <!-- jdbc driver -->
        <dependency>
            <groupId>${jdbc.driver.groupId}</groupId>
            <artifactId>${jdbc.driver.artifactId}</artifactId>
            <version>${jdbc.driver.version}</version>
        </dependency>


        <!-- PERSISTENCE end -->


        <!-- JSR303 BeanValidator -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${hibernate-validator.version}</version>
        </dependency>




        <!-- WEB begin -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>${freemarker.version}</version>
        </dependency>


        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>


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


        <!-- WEB end -->


        <!-- CACHE begin -->
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache-core</artifactId>
            <version>${ehcache.version}</version>
        </dependency>


        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.0.0</version>
        </dependency>


        <!-- CACHE end -->


        <!-- SECURITY begin -->
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-spring</artifactId>
            <version>${shiro.version}</version>
        </dependency>


        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-ehcache</artifactId>
            <version>${shiro.version}</version>
        </dependency>


        <!-- in private nexus repository !-->
        <dependency>
            <groupId>com.jagregory</groupId>
            <artifactId>shiro-freemarker-tags</artifactId>
            <version>0.1-SNAPSHOT</version>
        </dependency>




        <!-- SECURITY end -->


        <!-- LOGGING begin -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>




        <!-- common-logging 实际调用slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
        </dependency>




        <!-- java.utils.logging 实际调用slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
        </dependency>


        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
        </dependency>


        <!-- log4jdbc -->
        <dependency>
            <groupId>org.lazyluke</groupId>
            <artifactId>log4jdbc-remix</artifactId>
            <version>0.2.7</version>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <!-- LOGGING end -->


        <!-- XML begin -->
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.6.1</version>
            <exclusions>
                <exclusion>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <!-- 重新定义Java XPath Engine到最新版,避免旧版那些不必要的依赖 -->
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>1.1.4</version>
        </dependency>
        <!-- XML end -->


        <!-- JSON begin -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2</version>
        </dependency>


        <dependency>
            <groupId>org.codehaus</groupId>
            <artifactId>jackson-all</artifactId>
            <version>1.9.6</version>
        </dependency>


        <!-- JSON end -->


        <!-- JMS begin -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-core</artifactId>
            <version>${activemq.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.activemq.protobuf</groupId>
                    <artifactId>activemq-protobuf</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.osgi</groupId>
                    <artifactId>spring-osgi-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.osgi</groupId>
                    <artifactId>org.osgi.core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- JMS end -->


        <!-- GENERAL UTILS begin -->
        <!-- lang from 2.6 to 3.1 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>


        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>


        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
        </dependency>


        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.7</version>
        </dependency>


        <dependency>
            <groupId>commons-beanutils</groupId>   <!-- try net.sf.dozer instead-->
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
        </dependency>


        <!-- email -->
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
        </dependency>


        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-email</artifactId>
            <version>1.2</version>
        </dependency>


        <!-- MAP -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>


        <!-- DATE -->
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.1</version>
        </dependency>


        <!-- image -->
        <dependency>
            <groupId>net.sourceforge.barbecue</groupId>
            <artifactId>barbecue</artifactId>
            <version>1.5-beta1</version>
        </dependency>


        <!-- Excel API -->
        <dependency>
            <groupId>jxl</groupId>
            <artifactId>jxl</artifactId>
            <version>0.1</version>
        </dependency>




        <!-- captcha -->
        <dependency>
            <groupId>org.playframework</groupId>
            <artifactId>jj-simplecaptcha</artifactId>
            <version>1.1</version>
        </dependency>


        <!-- GENERAL UTILS end -->


        <!-- 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> -->


        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>2.0.6</version>
            <scope>test</scope>
        </dependency>








    </dependencies>


    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>javax.servlet.jsp</groupId>
                <artifactId>jsp-api</artifactId>
                <version>2.1</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <build>
        <plugins>


            <!-- Tomcat 插件 -->
            <!--<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId>
                <version>1.2-SNAPSHOT</version> <configuration> <url>http://localhost:9001/ztowls</url>
                </configuration> </plugin> -->


            <!-- jetty插件, 设定context path与spring profile -->
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.version}</version>
                <configuration>
                    <webAppConfig>
                        <contextPath>/${project.artifactId}</contextPath>
                    </webAppConfig>
                    <!-- 增加额外的webapp -->
                <!--<contextHandlers>
                      <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
                        <war>bin</war>
                        <contextPath>/bin</contextPath>
                      </contextHandler>
                      <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
                        <war>d:/files</war>
                        <contextPath>/media</contextPath>
                      </contextHandler>
                    </contextHandlers>
                    <stopKey/>
                    <stopPort/>-->
                </configuration>
            </plugin>


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


            <!-- war打包插件, 设定war包名称不带版本号 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <warName>${project.artifactId}</warName>
                </configuration>
            </plugin>


            <!-- enforcer插件, 设定环境与依赖的规则 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.1.1</version>
                <executions>
                    <execution>
                        <id>enforce-banned-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.0.4</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>1.6</version>
                                </requireJavaVersion>
                                <bannedDependencies>
                                    <searchTransitive>true</searchTransitive>
                                    <!-- 避免引入过期的jar包 -->
                                    <excludes>
                                        <exclude>junit:junit:*</exclude>
                                        <exclude>aspectj:aspectj*</exclude>
                                        <exclude>commons-lang:2.*</exclude>
                                        <exclude>org.springframework:2.*</exclude>
                                        <exclude>org.springframework:3.0.*</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>




            <!-- resource插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
            </plugin>


            <!-- install插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.4</version>
            </plugin>


            <!-- clean插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.5</version>
            </plugin>


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


            <!-- dependency插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
            </plugin>


            <!-- sonar插件,just for m3 -->
             <!-- <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>2.1</version>
              </plugin>-->


        </plugins>


    </build>


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值