Fork me on GitHub

Add Microsoft SQL JDBC driver to Maven

原文:http://claude.betancourt.us/add-microsoft-sql-jdbc-driver-to-maven/

sqlserver的驱动包 sqljdbc4.jar。很多maven仓库里都没找到这个jar,只能手动的下载来,然后添加到本地仓库里

步骤:

1. 本地下载sqljdbc4.jar

2. 解压到本地文件夹中,并找到sqljdbc4.jar路径

3. 打开命令窗口,执行以下语句(前提:先配置好maven环境变量)

mvn install:install-file -Dfile=C:\Users\Irving\Downloads\sqljdbc_4.0\chs\sqljdbc4.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar

4."BUILD SUCCESS"即添加成功

image

5.添加到POM
<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>sqljdbc4</artifactId>
    <version>4.0</version>
</dependency>

springMVC集成logback

https://github.com/qos-ch/logback-extensions

mvn install:install-file -Dfile=C:\Users\ytzhou\Downloads\logback-ext-spring-0.1.2.jar -DgroupId=ch.qos.logback -DartifactId=logback-ext-spring -Dversion=0.1.2 -Dpackaging=jar

<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-ext-spring</artifactId>
    <version>0.1.2</version>
</dependency>

配置XML

<context-param>
        <param-name>logbackConfigLocation</param-name>
        <param-value>classpath:logback.xml</param-value>
</context-param>
<listener>
        <listener-class>ch.qos.logback.ext.spring.web.LogbackConfigListener</listener-class>
</listener>
posted @ 2014-07-23 10:43  花儿笑弯了腰  阅读(381)  评论(0编辑  收藏  举报