文档章节

maven 配置文件示例

许雷神
 许雷神
发布于 2015/05/15 01:33
字数 661
阅读 38
收藏 0
<?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>jee.demo</groupId>
    <artifactId>login</artifactId>
    <version>1.0-SNAPSHOT</version>


    <packaging>war</packaging>

    <name>MSSH Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>

        <tomcat.version>7.0.32</tomcat.version>

        <spring.version>4.1.6.RELEASE</spring.version>
        <jackson.version>2.5.2</jackson.version>
        <hibernate.version>4.2.0.Final</hibernate.version>
        <hsqldb.version>2.3.2</hsqldb.version>
        <slf4j.version>1.7.12</slf4j.version>
        <log4j.version>2.2</log4j.version>
    </properties>

    <dependencies>
        <!-- 单元测试 -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- mchange C3P0 数据源 -->
        <dependency>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.5</version>
        </dependency>

        <!-- Servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>

        <!-- jstl -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
            <scope>runtime</scope>
        </dependency>

        <!-- spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</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-jdbc</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-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</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-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>

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

        <!-- 数据库hsqldb -->
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>${hsqldb.version}</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>${log4j.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${log4j.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency> <!-- 桥接:告诉commons logging使用Log4j2 -->
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-jcl</artifactId>
            <version>${log4j.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.4</version>
        </dependency>

        <!--<dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
            <scope>runtime</scope>
        </dependency>-->
    </dependencies>


    <build>
        <!-- Maven插件 -->
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>utf-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>utf-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <encoding>utf-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.7.2</version>
                <configuration>
                    <forkMode>once</forkMode>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                </configuration>
            </plugin>
        </plugins>
        
        <!-- 用maven快速将jar包打包成应用程序-->
         <pluginManagement>
  <plugins>
  <!-- Ignore/Execute plugin execution -->
   <plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
     <lifecycleMappingMetadata>
      <pluginExecutions>
       <pluginExecution>
        <pluginExecutionFilter>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
         <versionRange>[1.0.0,)</versionRange>
         <goals>
          <goal>copy-dependencies</goal>
          <goal>unpack</goal>
         </goals>
        </pluginExecutionFilter>
        <action>
         <ignore />
        </action>
       </pluginExecution>
      </pluginExecutions>
     </lifecycleMappingMetadata>
    </configuration>
   </plugin>
  </plugins>
  </pluginManagement>
 
 
  <plugins>
 
   <plugin>
 
    <groupId>org.apache.maven.plugins</groupId>
 
    <artifactId>maven-jar-plugin</artifactId>
 
    <configuration>
 
     <archive>
 
      <manifest>
 
       <addClasspath>true</addClasspath>
 
       <classpathPrefix>lib/</classpathPrefix>
 
       <mainClass>主函数的入口类</mainClass>
 
      </manifest>
 
     </archive>
 
    </configuration>
 
   </plugin>
 
   <plugin>
 
    <groupId>org.apache.maven.plugins</groupId>
 
    <artifactId>maven-dependency-plugin</artifactId>
 
    <executions>
 
     <execution>
 
      <id>copy</id>
 
      <phase>package</phase>
 
      <goals>
 
       <goal>copy-dependencies</goal>
 
      </goals>
 
      <configuration>
 
       <outputDirectory>${project.build.directory}/lib</outputDirectory>
 
      </configuration>
 
     </execution>
 
    </executions>
 
   </plugin>
 
  </plugins>
 
    </build>

    <repositories>
        <repository>
            <id>io.spring.repo.maven.milestone</id>
            <url>http://repo.spring.io/milestone/</url>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
    </repositories>
</project>


本文转载自:#

共有 人打赏支持
上一篇: 面试题
下一篇: jxl操作excel(转摘)
许雷神
粉丝 7
博文 13
码字总数 0
作品 0
广州
私信 提问
spring springmvc mybatis maven 项目整合示例-导航页面

spring原理 实践解析-简单的helloworld spring原理案例-基本项目搭建 01 spring framework 下载 官网下载spring jar包 spring原理案例-基本项目搭建 02 spring jar包详解 spring jar包的用途...

noteless
06/29
0
0
springmvc 项目完整示例02 项目创建-eclipse创建动态web项目 配置文件 junit单元测试

包结构 所需要的jar包直接拷贝到lib目录下 然后选定 build path 之后开始写项目代码 配置文件 ApplicationContext.xml

noteless
2016/02/24
0
0
spring原理案例-基本项目搭建 03 创建工程运行测试 spring ioc原理实例示例

下面开始项目的搭建 使用 Java EE - Eclipse 新建一 Dynamic Web Project Target Runtime 选 Apache Tomcat 7.0(不要选 Apache Tomcat 6.0,7 以后才支持 Servlet 3.0)。 点击 Next > 按钮。......

noteless
2016/02/24
0
0
spring原理案例-基本项目搭建 01 spring framework 下载 官网下载spring jar包

下载spring http://spring.io/ 最重要是在特征下面的这段话,需要注意: All avaible features and modules are described in the Modules section of the reference documentation. Their ......

noteless
2016/02/24
0
0
springmvc 项目完整示例05 日志 --log4j整合 配置 log4j属性设置 log4j 配置文件 log4j应用

log4j 就是log for java嘛,老外都喜欢这样子,比如那个I18n ---internationalization 不就是i和n之间有18个字母... http://logging.apache.org/log4j/2.x/ 直接入正题 他是一个强大的日止功能...

noteless
2016/02/24
0
0

没有更多内容

加载失败,请刷新页面

加载更多

开源 java CMS - FreeCMS2.8会员注册

项目地址:http://www.freeteam.cn/ 会员注册 打开浏览器,输入http://www.freeteam.cn/register.jsp。 输入注册信息后点击“注册”按钮。...

freeteam
20分钟前
1
0
sql笔记——查询

查询语句: SELECT [ALL|DISTINCT]<目标列表达式>[,<目标列表达式>]... FROM <表名或这视图名>[,<表名或这视图名>]... [WHERE<条件表达式>] [GROUP BY <列名 1>[HAVING<条件表达式>]] [ORDE......

Carbenson
22分钟前
2
0
OSChina 周二乱弹 —— 哥们之间报恩的想法被上帝实现了

Osc乱弹歌单(2018)请戳(这里) 【今日歌曲】 小小编辑:推荐歌曲《消愁》 《消愁》- 毛不易 手机党少年们想听歌,请使劲儿戳(这里) @过遥 :周一的早上就应该用来补觉,太困了 周末不想...

小小编辑
今天
597
11
MariaDB 服务器在 MySQL Workbench 备份数据的时候出错如何解决

服务器是运行在 MariaDB 10.2 上面的,在使用 MySQL Workbench 出现错误: mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"'......

honeymose
今天
3
0
apache顶级项目(二) - B~C

apache顶级项目(二) - B~C https://www.apache.org/ Bahir Apache Bahir provides extensions to multiple distributed analytic platforms, extending their reach with a diversity of s......

晨猫
今天
7
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部