JEEWEB的Maven的配置文件pom.xml
简介:
什么是POM?
POM是项目对象模型(Project Object Model)的简称,它是Maven项目中的文件,使用XML表示,名称叫做pom.xml。在Maven中,当谈到Project的时候,不仅仅是一堆包含代码的文件。一个Project往往包含一个配置文件,包括了与开发者有关的,缺陷跟踪系统,组织与许可,项目的URL,项目依赖,以及其他。它包含了所有与这个项目相关的东西。事实上,在Maven世界中,project可以什么都没有,甚至没有代码,但是必须包含pom.xml文件。
概览
下面是一个POM项目中的pom.xml文件中包含的元素。注意,其中的modelVersion是4.0.0,这是当前仅有的可以被Maven2&3同时支持的POM版本,它是必须的。
- <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>...</groupId>
- <artifactId>...</artifactId>
- <version>...</version>
- <packaging>...</packaging>
- <dependencies>...</dependencies>
- <parent>...</parent>
- <dependencyManagement>...</dependencyManagement>
- <modules>...</modules>
- <properties>...</properties>
- <!-- 构建过程的设置 -->
- <build>...</build>
- <reporting>...</reporting>
- <!-- 项目信息设置 -->
- <name>...</name>
- <description>...</description>
- <url>...</url>
- <inceptionYear>...</inceptionYear>
- <licenses>...</licenses>
- <organization>...</organization>
- <developers>...</developers>
- <contributors>...</contributors>
- <!-- 环境设置 -->
- <issueManagement>...</issueManagement>
- <ciManagement>...</ciManagement>
- <mailingLists>...</mailingLists>
- <scm>...</scm>
- <prerequisites>...</prerequisites>
- <repositories>...</repositories>
- <pluginRepositories>...</pluginRepositories>
- <distributionManagement>...</distributionManagement>
- <profiles>...</profiles>
- </project>
基本的设置:
POM包含了一个project所需要的所有信息,当然也就包含了构建过程中所需要的插件的配置信息,事实上,这里申明了"who","what",和"where",然而构建生命周期(build lifecycle)s中说的是"when"和"how"。这并不是说POM并能影响生命周期的过程-事实上它可以。例如,配置一个可以嵌入ant任务到POM的mavem-antrun-plugin。它基本上就是一个声明。就像build.xml告诉ant当运行时它该做什么一样,一个POM申明了它自己的配置。如果外力迫使生命周期跳过了ant插件的执行,这并不影响那些已经执行过的插件产生的效果。这一点和build.xml不一样。
Maven坐标
上面的POM定义的是Maven2&3都承认的最小部分。groupId:artifactId:version是必须的字段(尽管在继承中groupId和version不需要明确指出)。这三个字段就像地址和邮戳,它标记了仓库中的特定位置,就像Maven projects的坐标系统一样。
JEEWEB详细配置如下:
- <?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>html580.jeeweb</groupId>
- <artifactId>jeeweb</artifactId>
- <packaging>war</packaging>
- <version>1.0-SNAPSHOT</version>
- <name>jeeweb</name>
- <url>https://github.com/html580/JEEWEB</url>
- <organization>
- <name>jeeweb</name>
- <url>http://bbs.html580.com/forum.php?gid=47</url>
- </organization>
- <!-- 设定除*仓库(repo1.maven.org/maven2/)外的其他仓库,按设定顺序进行查找. -->
- <repositories>
- <!-- 如有Nexus私服, 取消注释并指向正确的服务器地址.
- <repository>
- <id>nexus-repos</id>
- <name>Team Nexus Repository</name>
- <url>http://localhost:8081/nexus/content/groups/public</url>
- </repository>-->
- <repository>
- <id>apache-repo</id>
- <name>apache Repository</name>
- <url>https://repository.apache.org/content/groups/public/</url>
- </repository>
- <repository>
- <id>java-repo</id>
- <name>java Repository</name>
- <url>http://download.java.net/maven/2/</url>
- </repository>
- <repository>
- <id>springsource-repo</id>
- <name>SpringSource Repository</name>
- <url>http://repo.spring.io/release/</url>
- </repository>
- <repository>
- <id>springsource-repo-snapshot</id>
- <name>SpringSource Repository</name>
- <url>http://repo.spring.io/snapshot/</url>
- </repository>
- <repository>
- <id>cloudhopper</id>
- <name>Repository for Cloudhopper</name>
- <url>http://maven.cloudhopper.com/repos/third-party/</url>
- </repository>
- <repository>
- <id>jboss-repo-releases</id>
- <name>Jboss Repository</name>
- <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
- </repository>
- <repository>
- <id>central</id>
- <name>Maven Repository Switchboard</name>
- <layout>default</layout>
- <url>http://repo.maven.apache.org/maven2</url>
- </repository>
- <repository>
- <id>maven-repo1</id>
- <name>maven-repo1</name>
- <layout>default</layout>
- <url>http://repo1.maven.org/maven2/</url>
- </repository>
- <repository>
- <id>sourceforge-releases</id>
- <name>Sourceforge Releases</name>
- <url>https://oss.sonatype.org/content/repositories/sourceforge-releases/</url>
- </repository>
- </repositories>
- <!-- 开发人员信息 -->
- <developers>
- <developer>
- <name>dengzhifeng</name>
- <email>280160522@qq.com</email>
- <url>http://www.html580.com</url>
- <roles>
- <role>software engineer</role>
- </roles>
- <timezone>8</timezone>
- </developer>
- </developers>
- <!--许可证 -->
- <licenses>
- <license>
- <name>Apache License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0</url>
- </license>
- </licenses>
- <!-- 问题反馈信息 -->
- <issueManagement>
- <system>JEEWEB</system>
- <url>http://bbs.html580.com/forum.php?gid=47</url>
- </issueManagement>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <!-- version setting -->
- <asm.version>4.2</asm.version>
- <cglib.version>3.1</cglib.version>
- <commons-lang3.version>3.1</commons-lang3.version>
- <common-collections4.version>4.0</common-collections4.version>
- <commons-io.version>2.4</commons-io.version>
- <guava.version>15.0</guava.version>
- <common.fileupload.version>1.3</common.fileupload.version>
- <common.compress.version>1.6</common.compress.version>
- <ant.version>1.9.2</ant.version>
- <junit.version>4.11</junit.version>
- <mockito.version>1.9.5</mockito.version>
- <powermock.version>1.5.2</powermock.version>
- <h2.version>1.3.174</h2.version>
- <jetty.version>8.1.8.v20121106</jetty.version>
- <servlet.version>3.0.1</servlet.version>
- <jsp.version>2.2</jsp.version>
- <jstl.version>1.2</jstl.version>
- <standard.version>1.1.2</standard.version>
- <aspectj.version>1.7.4</aspectj.version>
- <spring.version>4.0.0.RELEASE</spring.version>
- <spring.data.jpa.version>1.4.1.RELEASE</spring.data.jpa.version>
- <hibernate.core.version>4.3.0.Final</hibernate.core.version>
- <hibernate.ehcache.version>4.3.0.Final</hibernate.ehcache.version>
- <hibernate.commons.annotaions.version>4.0.4.Final</hibernate.commons.annotaions.version>
- <hibernate.validator.version>5.0.2.Final</hibernate.validator.version>
- <javassist.version>3.18.0-GA</javassist.version>
- <ehcache.core.version>2.6.6</ehcache.core.version>
- <shiro.version>1.2.2</shiro.version>
- <slf4j.version>1.7.5</slf4j.version>
- <logback.version>1.0.13</logback.version>
- <druid.version>0.2.23</druid.version>
- <fastjson.version>1.1.34</fastjson.version>
- <httpclient.version>4.3.1</httpclient.version>
- <dom4j.version>1.6.1</dom4j.version>
- <joda-time.version>2.3</joda-time.version>
- <prettytime.version>3.2.3.Final</prettytime.version>
- <jcaptcha.version>2.0-alpha-1</jcaptcha.version>
- <jsoup.version>1.7.3</jsoup.version>
- <!-- mysql driver setting -->
- <jdbc.driver.groupId>mysql</jdbc.driver.groupId>
- <jdbc.driver.artifactId>mysql-connector-java</jdbc.driver.artifactId>
- <jdbc.driver.version>5.1.13</jdbc.driver.version>
- <!-- oracle driver setting
- <jdbc.driver.groupId>com.oracle</jdbc.driver.groupId>
- <jdbc.driver.artifactId>ojdbc14</jdbc.driver.artifactId>
- <jdbc.driver.version>10.2.0.1.0</jdbc.driver.version> -->
- <!-- mssql driver setting
- <jdbc.driver.groupId>net.sourceforge.jtds</jdbc.driver.groupId>
- <jdbc.driver.artifactId>jtds</jdbc.driver.artifactId>
- <jdbc.driver.version>1.2.4</jdbc.driver.version> -->
- <!-- other setting -->
- <jdk.version>1.6</jdk.version>
- <tomcat.version>2.1</tomcat.version>
- <jetty.version>7.6.10.v20130312</jetty.version>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
- <!-- 依赖项定义 -->
- <dependencies>
- <!-- 测试相关jar包 -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>${mockito.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId> com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>${h2.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <artifactId>javax.servlet</artifactId>
- <groupId>org.eclipse.jetty.orbit</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- cglib asm 相关jar包-->
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <version>${cglib.version}</version>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm</artifactId>
- <version>${asm.version}</version>
- </dependency>
- <!-- utils 相关jar包 -->
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>${commons-lang3.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- <version>${common-collections4.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons-io.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <version>1.8.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>${common.fileupload.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- <version>${common.compress.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>${ant.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>ant-launcher</artifactId>
- <groupId>org.apache.ant</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- data source 相关jar包-->
- <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>
- <scope>runtime</scope>
- </dependency>
- <!-- 日志相关jar包 -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>${slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <version>${logback.version}</version>
- </dependency>
- <!-- web相关jar包 -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>${servlet.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>${jsp.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>standard</artifactId>
- <version>${standard.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>${jstl.version}</version>
- </dependency>
- <!-- aspectj相关jar包-->
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>${aspectj.version}</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>${aspectj.version}</version>
- </dependency>
- <!-- spring相关jar包 -->
- <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-jdbc</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-tx</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <!-- spring webmvc相关jar包 -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <!-- spring jpa -->
- <dependency>
- <groupId>org.springframework.data</groupId>
- <artifactId>spring-data-jpa</artifactId>
- <version>${spring.data.jpa.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>jcl-over-slf4j</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- hibernate相关jar包 -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>${hibernate.core.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <version>${hibernate.core.version}</version>
- </dependency>
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${javassist.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-ehcache</artifactId>
- <version>${hibernate.ehcache.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>ehcache-core</artifactId>
- <groupId>net.sf.ehcache</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.hibernate.common</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>${hibernate.commons.annotaions.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- hibernate validator 相关jar包 -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>${hibernate.validator.version}</version>
- </dependency>
- <!-- apache shiro 相关jar包 -->
- <dependency>
- <groupId>org.apache.shiro</groupId>
- <artifactId>shiro-core</artifactId>
- <version>${shiro.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shiro</groupId>
- <artifactId>shiro-web</artifactId>
- <version>${shiro.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shiro</groupId>
- <artifactId>shiro-aspectj</artifactId>
- <version>${shiro.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shiro</groupId>
- <artifactId>shiro-ehcache</artifactId>
- <version>${shiro.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shiro</groupId>
- <artifactId>shiro-spring</artifactId>
- <version>${shiro.version}</version>
- </dependency>
- <!--<dependency>-->
- <!--<groupId>org.apache.shiro</groupId>-->
- <!--<artifactId>shiro-quartz</artifactId>-->
- <!--<version>${shiro.version}</version>-->
- <!--<exclusions>-->
- <!--<exclusion>-->
- <!--<artifactId>quartz</artifactId>-->
- <!--<groupId>org.opensymphony.quartz</groupId>-->
- <!--</exclusion>-->
- <!--</exclusions>-->
- <!--</dependency>-->
- <!-- quartz -->
- <!--<dependency>-->
- <!--<groupId>org.quartz-scheduler</groupId>-->
- <!--<artifactId>quartz</artifactId>-->
- <!--<version>${quartz.version}</version>-->
- <!--<exclusions>-->
- <!--<exclusion>-->
- <!--<artifactId>c3p0</artifactId>-->
- <!--<groupId>c3p0</groupId>-->
- <!--</exclusion>-->
- <!--</exclusions>-->
- <!--</dependency>-->
- <!-- encache 相关jar包 -->
- <dependency>
- <groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache-core</artifactId>
- <version>${ehcache.core.version}</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <artifactId>slf4j-api</artifactId>
- <groupId>org.slf4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- json 相关jar包 -->
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>fastjson</artifactId>
- <version>${fastjson.version}</version>
- </dependency>
- <!-- 安全相关jar包 -->
- <!-- httpclient相关jar包 -->
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>${httpclient.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!--dom4j-->
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- <version>${dom4j.version}</version>
- <exclusions>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- 时间相关 -->
- <!--日期美化-->
- <dependency>
- <groupId>org.ocpsoft.prettytime</groupId>
- <artifactId>prettytime</artifactId>
- <version>${prettytime.version}</version>
- </dependency>
- <!-- joda time 相关jar包 -->
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <version>${joda-time.version}</version>
- </dependency>
- <!-- jcaptcha 验证码 -->
- <dependency>
- <groupId>com.octo.captcha</groupId>
- <artifactId>jcaptcha</artifactId>
- <version>${jcaptcha.version}</version>
- </dependency>
- <dependency>
- <groupId>com.octo.captcha</groupId>
- <artifactId>jcaptcha-integration-simple-servlet</artifactId>
- <version>${jcaptcha.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>servlet-api</artifactId>
- <groupId>javax.servlet</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- html处理jar包 -->
- <dependency>
- <groupId>org.jsoup</groupId>
- <artifactId>jsoup</artifactId>
- <version>${jsoup.version}</version>
- </dependency>
- </dependencies>
- <build>
- <outputDirectory>${project.basedir}/src/main/webapp/WEB-INF/classes/</outputDirectory>
- <plugins>
- <!-- 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>
- <!-- Eclipse 插件 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.9</version>
- <configuration>
- <downloadSources>false</downloadSources>
- <downloadJavadocs>false</downloadJavadocs>
- <wtpversion>2.0</wtpversion>
- <!-- 增加设置项目encoding的文件 -->
- <additionalConfig>
- <file>
- <name>.settings/org.eclipse.core.resources.prefs</name>
- <content>
- <![CDATA[eclipse.preferences.version=1${line.separator}encoding/<project>=${project.build.sourceEncoding}${line.separator}]]>
- </content>
- </file>
- </additionalConfig>
- <additionalProjectnatures>
- <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
- </additionalProjectnatures>
- </configuration>
- </plugin>
- <!-- tomcat6插件 -->
- <plugin>
- <groupId>org.apache.tomcat.maven</groupId>
- <artifactId>tomcat6-maven-plugin</artifactId>
- <version>${tomcat.version}</version>
- <configuration>
- <path>/${project.artifactId}</path>
- </configuration>
- </plugin>
- <!-- tomcat7插件 -->
- <plugin>
- <groupId>org.apache.tomcat.maven</groupId>
- <artifactId>tomcat7-maven-plugin</artifactId>
- <version>${tomcat.version}</version>
- <configuration>
- <path>/${project.artifactId}</path>
- </configuration>
- </plugin>
- <!-- jetty插件 -->
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>${jetty.version}</version>
- <configuration>
- <webAppConfig>
- <contextPath>/${project.artifactId}</contextPath>
- </webAppConfig>
- </configuration>
- </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.5.1</version>
- </plugin>
- </plugins>
- </build>
- </project>
转自: http://bbs.html580.com/forum.php?mod=viewthread&tid=178107&extra=page%3D1
上一篇: struts-config文件路径问题
下一篇: fcntl 记录锁