【Maven】pom.xml(1)

在pom.xml加入:

 
  1. <build>  
  2.      <finalName>oauth2</finalName>  
  3.      <resources>  
  4.     <resource>  
  5.         <directory>src/main/resources</directory>  
  6.         <includes>  
  7.             <include>**/*.xml</include>  
  8.             <include>**/*.properties</include>  
  9.             <include>**/*.jsp</include>  
  10.         </includes>  
  11.         <filtering>true</filtering>  
  12.     </resource>  
  13. </resources>  
  14.   
  15.  <plugins>  
  16.     <plugin>  
  17.         <groupId>org.mortbay.jetty</groupId>  
  18.         <artifactId>jetty-maven-plugin</artifactId>  
  19.         <version>8.1.14.v20131031</version>  
  20.         <configuration>  
  21.             <scanIntervalSeconds>30</scanIntervalSeconds>  
  22.             <webApp>  
  23.                 <contextPath>/</contextPath>  
  24.             </webApp>  
  25.         </configuration>  
  26.     </plugin>  
  27. </plugins>  
  28. </build>  

或者加入:

 
  1. <build>  
  2.      <finalName>oauth2</finalName>  
  3.      <resources>  
  4.     <resource>  
  5.         <directory>src/main/resources</directory>  
  6.         <includes>  
  7.             <include>**/*.xml</include>  
  8.             <include>**/*.properties</include>  
  9.             <include>**/*.jsp</include>  
  10.         </includes>  
  11.         <filtering>true</filtering>  
  12.     </resource>  
  13. </resources>  
  14.   
  15.  <plugins>  
  16.     <plugin>  
  17.         <groupId>org.apache.maven.plugins</groupId>  
  18.         <artifactId>maven-compiler-plugin</artifactId>  
  19.         <version>2.5.1</version>  
  20.         <configuration>  
  21.             <source>1.6</source>  
  22.             <target>1.6</target>  
  23.         </configuration>  
  24.     </plugin>  
  25.     <plugin>  
  26.         <groupId>org.apache.maven.plugins</groupId>  
  27.         <artifactId>maven-surefire-plugin</artifactId>  
  28.         <version>2.12</version>  
  29.         <configuration>  
  30.             <includes>  
  31.                 <include>**/*Test.java</include>  
  32.             </includes>  
  33.             <excludes>  
  34.                 <exclude>**/Abstract*.java</exclude>  
  35.                 <exclude>**/*Main.java</exclude>  
  36.             </excludes>  
  37.             <junitArtifactName>junit:junit</junitArtifactName>  
  38.             <argLine>-Xmx512m</argLine>  
  39.         </configuration>  
  40.     </plugin>  
  41.     <plugin>  
  42.         <groupId>org.mybatis.generator</groupId>  
  43.         <artifactId>mybatis-generator-maven-plugin</artifactId>  
  44.         <version>${mybatis.generator.version}</version>  
  45.     </plugin>  
  46.     <plugin>  
  47.         <groupId>org.mortbay.jetty</groupId>  
  48.         <artifactId>jetty-maven-plugin</artifactId>  
  49.         <version>8.1.14.v20131031</version>  
  50.         <configuration>  
  51.             <scanIntervalSeconds>30</scanIntervalSeconds>  
  52.             <webApp>  
  53.                 <contextPath>/</contextPath>  
  54.             </webApp>  
  55.         </configuration>  
  56.     </plugin>  
  57. </plugins>  
  58. </build>  


整个pom.xml的配置

    1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
    2.   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">  
    3.   <modelVersion>4.0.0</modelVersion>  
    4.   <groupId>com.xuan</groupId>  
    5.   <artifactId>oauth2</artifactId>  
    6.   <packaging>war</packaging>  
    7.   <version>0.0.1-SNAPSHOT</version>  
    8.   <name>maven</name>  
    9.   <url>http://maven.apache.org</url>  
    10.     
    11.     
    12.     <properties>  
    13.         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
    14.         <junit.version>4.8.2</junit.version>  
    15.         <servlet.version>2.5</servlet.version>  
    16.         <jsp.version>2.1</jsp.version>  
    17.         <slf4j.version>1.6.6</slf4j.version>  
    18.         <log4j.version>1.2.14</log4j.version>  
    19.         <commons.lang3.version>3.1</commons.lang3.version>  
    20.         <commons.codec.version>1.8</commons.codec.version>  
    21.         <httpcomponents.version>4.2.5</httpcomponents.version>  
    22.         <commons.fileupload.version>1.2.2</commons.fileupload.version>  
    23.         <commons.io.version>2.4</commons.io.version>  
    24.         <commons.email.version>1.2</commons.email.version>  
    25.         <commons.validator.version>1.4.0</commons.validator.version>  
    26.         <commons.exec.version>1.2</commons.exec.version>  
    27.         <mysql.connector.java.version>5.1.25</mysql.connector.java.version>  
    28.         <tomcat.jdbc.version>7.0.39</tomcat.jdbc.version>  
    29.         <spring.version>3.1.2.RELEASE</spring.version>  
    30.         <mybatis.version>3.2.5</mybatis.version>  
    31.         <mybatis.spring.version>1.2.2</mybatis.spring.version>  
    32.         <mybatis.generator.version>1.3.2</mybatis.generator.version>  
    33.         <freemarker.version>2.3.19</freemarker.version>  
    34.         <jackson.version>2.0.1</jackson.version>  
    35.         <spymemcached.version>2.10.6</spymemcached.version>  
    36.   
    37.         <!-- Used by MyBatis Generator to Generate Codes -->  
    38.         <classPathEntry.mysql.location>${basedir}/target/${project.artifactId}/WEB-INF/lib/mysql-connector-java-${mysql.connector.java.version}.jar</classPathEntry.mysql.location>  
    39.         <javaModelGenerator.targetProject>${basedir}/src/main/java</javaModelGenerator.targetProject>  
    40.         <sqlMapGenerator.targetProject>${basedir}/src/main/resources</sqlMapGenerator.targetProject>  
    41.         <javaClientGenerator.targetProject>${basedir}/src/main/java</javaClientGenerator.targetProject>  
    42.         <mybatis.generator.configurationFile>${basedir}/src/test/resources/generatorConfig.xml</mybatis.generator.configurationFile>  
    43.         <mybatis.generator.overwrite>true</mybatis.generator.overwrite>  
    44.     </properties>  
    45.     
    46.     
    47.   <dependencies>  
    48.     <dependency>  
    49.             <groupId>junit</groupId>  
    50.             <artifactId>junit</artifactId>  
    51.             <version>${junit.version}</version>  
    52.             <scope>test</scope>  
    53.         </dependency>  
    54.         <dependency>  
    55.             <groupId>javax.servlet</groupId>  
    56.             <artifactId>servlet-api</artifactId>  
    57.             <version>${servlet.version}</version>  
    58.             <scope>provided</scope>  
    59.         </dependency>  
    60.         <dependency>  
    61.             <groupId>javax.servlet.jsp</groupId>  
    62.             <artifactId>jsp-api</artifactId>  
    63.             <version>${jsp.version}</version>  
    64.             <scope>provided</scope>  
    65.         </dependency>  
    66.   
    67.         <dependency>  
    68.             <groupId>org.slf4j</groupId>  
    69.             <artifactId>slf4j-api</artifactId>  
    70.             <version>${slf4j.version}</version>  
    71.         </dependency>  
    72.         <dependency>  
    73.             <groupId>org.slf4j</groupId>  
    74.             <artifactId>slf4j-log4j12</artifactId>  
    75.             <version>${slf4j.version}</version>  
    76.             <exclusions>  
    77.                 <exclusion>  
    78.                     <groupId>com.sun.jmx</groupId>  
    79.                     <artifactId>jmxri</artifactId>  
    80.                 </exclusion>  
    81.                 <exclusion>  
    82.                     <groupId>com.sun.jdmk</groupId>  
    83.                     <artifactId>jmxtools</artifactId>  
    84.                 </exclusion>  
    85.                 <exclusion>  
    86.                     <groupId>javax.jms</groupId>  
    87.                     <artifactId>jms</artifactId>  
    88.                 </exclusion>  
    89.             </exclusions>  
    90.         </dependency>  
    91.         <dependency>  
    92.             <groupId>log4j</groupId>  
    93.             <artifactId>log4j</artifactId>  
    94.             <version>${log4j.version}</version>  
    95.         </dependency>  
    96.   
    97.         <dependency>  
    98.             <groupId>org.apache.commons</groupId>  
    99.             <artifactId>commons-lang3</artifactId>  
    100.             <version>${commons.lang3.version}</version>  
    101.         </dependency>  
    102.         <dependency>  
    103.             <groupId>commons-codec</groupId>  
    104.             <artifactId>commons-codec</artifactId>  
    105.             <version>${commons.codec.version}</version>  
    106.         </dependency>  
    107.         <dependency>  
    108.             <groupId>org.apache.httpcomponents</groupId>  
    109.             <artifactId>httpclient</artifactId>  
    110.             <version>${httpcomponents.version}</version>  
    111.         </dependency>  
    112.         <dependency>  
    113.             <groupId>commons-fileupload</groupId>  
    114.             <artifactId>commons-fileupload</artifactId>  
    115.             <version>${commons.fileupload.version}</version>  
    116.         </dependency>  
    117.         <dependency>  
    118.             <groupId>commons-io</groupId>  
    119.             <artifactId>commons-io</artifactId>  
    120.             <version>${commons.io.version}</version>  
    121.         </dependency>  
    122.         <dependency>  
    123.             <groupId>org.apache.commons</groupId>  
    124.             <artifactId>commons-email</artifactId>  
    125.             <version>${commons.email.version}</version>  
    126.         </dependency>  
    127.         <dependency>  
    128.             <groupId>commons-validator</groupId>  
    129.             <artifactId>commons-validator</artifactId>  
    130.             <version>${commons.validator.version}</version>  
    131.         </dependency>  
    132.         <dependency>  
    133.             <groupId>org.apache.commons</groupId>  
    134.             <artifactId>commons-exec</artifactId>  
    135.             <version>${commons.exec.version}</version>  
    136.         </dependency>  
    137.   
    138.         <dependency>  
    139.             <groupId>mysql</groupId>  
    140.             <artifactId>mysql-connector-java</artifactId>  
    141.             <version>${mysql.connector.java.version}</version>  
    142.         </dependency>  
    143.         <dependency>  
    144.             <groupId>org.apache.tomcat</groupId>  
    145.             <artifactId>tomcat-jdbc</artifactId>  
    146.             <version>${tomcat.jdbc.version}</version>  
    147.         </dependency>  
    148.   
    149.         <dependency>  
    150.             <groupId>org.springframework</groupId>  
    151.             <artifactId>spring-core</artifactId>  
    152.             <version>${spring.version}</version>  
    153.         </dependency>  
    154.         <dependency>  
    155.             <groupId>org.springframework</groupId>  
    156.             <artifactId>spring-context</artifactId>  
    157.             <version>${spring.version}</version>  
    158.         </dependency>  
    159.         <dependency>  
    160.             <groupId>org.springframework</groupId>  
    161.             <artifactId>spring-web</artifactId>  
    162.             <version>${spring.version}</version>  
    163.         </dependency>  
    164.         <dependency>  
    165.             <groupId>org.springframework</groupId>  
    166.             <artifactId>spring-webmvc</artifactId>  
    167.             <version>${spring.version}</version>  
    168.         </dependency>  
    169.         <dependency>  
    170.             <groupId>org.springframework</groupId>  
    171.             <artifactId>spring-orm</artifactId>  
    172.             <version>${spring.version}</version>  
    173.         </dependency>  
    174.         <dependency>  
    175.             <groupId>org.springframework</groupId>  
    176.             <artifactId>spring-tx</artifactId>  
    177.             <version>${spring.version}</version>  
    178.         </dependency>  
    179.         <dependency>  
    180.             <groupId>org.mybatis</groupId>  
    181.             <artifactId>mybatis</artifactId>  
    182.             <version>${mybatis.version}</version>  
    183.         </dependency>  
    184.         <dependency>  
    185.             <groupId>org.mybatis</groupId>  
    186.             <artifactId>mybatis-spring</artifactId>  
    187.             <version>${mybatis.spring.version}</version>  
    188.         </dependency>  
    189.         <dependency>  
    190.             <groupId>org.freemarker</groupId>  
    191.             <artifactId>freemarker</artifactId>  
    192.             <version>${freemarker.version}</version>  
    193.         </dependency>  
    194.   
    195.         <!-- 支持JSON输出 -->  
    196.         <dependency>  
    197.             <groupId>com.fasterxml.jackson.core</groupId>  
    198.             <artifactId>jackson-core</artifactId>  
    199.             <version>${jackson.version}</version>  
    200.         </dependency>  
    201.         <dependency>  
    202.             <groupId>com.fasterxml.jackson.core</groupId>  
    203.             <artifactId>jackson-databind</artifactId>  
    204.             <version>${jackson.version}</version>  
    205.         </dependency>  
    206.           
    207.         <dependency>  
    208.             <groupId>net.spy</groupId>  
    209.             <artifactId>spymemcached</artifactId>  
    210.             <version>${spymemcached.version}</version>  
    211.         </dependency>  
    212.       
    213.     <!--       
    214.         <dependency>  
    215.             <groupId>com.jodconverter-code</groupId>  
    216.             <artifactId>jodconverter</artifactId>  
    217.             <version>2.2.2</version>  
    218.         </dependency>  
    219.      -->  
    220.   </dependencies>  
    221.     
    222.     
    223.     
    224.   <build>  
    225.        <finalName>oauth2</finalName>  
    226.        <resources>  
    227.             <resource>  
    228.                 <directory>src/main/resources</directory>  
    229.                 <includes>  
    230.                     <include>**/*.xml</include>  
    231.                     <include>**/*.properties</include>  
    232.                     <include>**/*.jsp</include>  
    233.                 </includes>  
    234.                 <filtering>true</filtering>  
    235.             </resource>  
    236.         </resources>  
    237.           
    238.       <plugins>  
    239.             <plugin>  
    240.                 <groupId>org.mortbay.jetty</groupId>  
    241.                 <artifactId>jetty-maven-plugin</artifactId>  
    242.                 <version>8.1.14.v20131031</version>  
    243.                 <configuration>  
    244.                     <scanIntervalSeconds>30</scanIntervalSeconds>  
    245.                     <webApp>  
    246.                         <contextPath>/</contextPath>  
    247.                     </webApp>  
    248.                 </configuration>  
    249.             </plugin>  
    250.         </plugins>  
    251.   </build>  
    252.     
    253. </project
posted @ 2017-06-22 15:58  baoyu7yi  阅读(229)  评论(0编辑  收藏  举报