maven項目的經常使用依賴

maven經常使用依賴

mybatis

<dependency>
	<groupId>org.mybatis</groupId>
	<artifactId>mybatis</artifactId>
	<version>3.3.0</version>
</dependency>

jetty

<plugin> 
  <groupId>org.mortbay.jetty</groupId>  
  <artifactId>jetty-maven-plugin</artifactId>  
  <version>8.1.5.v20120716</version>  
  <configuration> 
    <stopKey>foo</stopKey>
    <stopPort>9999</stopPort>
    <scanIntervalSeconds>10</scanIntervalSeconds>  
    <webApp> 
      <contextPath>/</contextPath> 
    </webApp> 
  </configuration> 
</plugin>

spring

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>4.1.1.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
    </dependency>
<dependencies>

只有當外層的dependency元素中沒有指明版本信息時,dependencyManagement中的dependencies元素纔會起做用java

spring 僅使用slf4j做爲日誌模塊

  1. 從spring-core模塊中移除掉commons-loggingmysql

    <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <exclusions> <!-- Exclude Commons Logging in favor of SLF4j --> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency>web

  2. 使用SLF4Jspring

    <!-- Logging --> sql

    <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency>json

hibernate

struts2

mysql

junit

<dependency>
	<groupId>junit</groupId>
	<artifactId>junit</artifactId>
	<version>4.11</version>
</dependency>

servlet

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

json-lib

<!--json-lib-->  
<dependency>  
    <groupId>net.sf.json-lib</groupId>  
    <artifactId>json-lib</artifactId>  
    <version>2.4</version>  
    <classifier>jdk15</classifier>  
</dependency>

jstl

<dependency>
    <groupid>javax.servlet</groupid>
    <artifactid>jstl</artifactid>
    <version>1.2</version>
    <scope>runtime</scope>
</dependency>
相關文章
相關標籤/搜索