安裝java memcached client到maven repository

因爲目前java memcached client沒有官方的maven repository可供使用,所以使用時須要手動將其安裝到本地repository。java memcached client的jar包下載地址:https://github.com/gwhalin/Memcached-Java-Client/downloads 目前2.6.2版本的java memcached client要依賴slf4j-simple、slf4j-api、commons-pool三個包,依此咱們能夠爲其編輯一個pom文件,將java memcached client的jar包和pom文件一塊兒安裝,解決java memcached client對其餘jar包的依賴。安裝命令: html

mvn install:install-file -Dfile=/path/to/java-memcached-release_2.6.2.jar -DpomFile=/path/to/java-memcached-2.6.2.pom java

其中java-memcached-2.6.2.pom的內容爲:

[html]  view plain copy
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"  
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  
  4.   <modelVersion>4.0.0</modelVersion>  
  5.   <groupId>com.danga</groupId>  
  6.   <artifactId>java-memcached</artifactId>  
  7.   <version>2.6.2</version>  
  8. <dependencies>  
  9.     <dependency>  
  10.         <groupId>org.slf4j</groupId>  
  11.         <artifactId>slf4j-simple</artifactId>  
  12.         <version>1.6.2</version>  
  13.     </dependency>  
  14.     <dependency>  
  15.         <groupId>org.slf4j</groupId>  
  16.         <artifactId>slf4j-api</artifactId>  
  17.         <version>1.6.2</version>  
  18.     </dependency>  
  19.     <dependency>  
  20.         <groupId>commons-pool</groupId>  
  21.         <artifactId>commons-pool</artifactId>  
  22.         <version>1.5.6</version>  
  23.     </dependency>  
  24. </dependencies>  
  25. </project>
相關文章
相關標籤/搜索