参考:
http://jason61719.iteye.com/blog/1002141
http://blog.csdn.net/bluishglc/article/details/6910556
1.下载最新版本的memcached-java-client
https://github.com/gwhalin/Memcached-Java-Client/downloads
2.以2.6.2版本为例
2.1新建pom文件
<?xml version="1.0" encoding="UTF-8"?>
<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"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.danga</groupId>
<artifactId>java-memcached</artifactId>
<version>2.6.2</version>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.5.6</version>
</dependency>
</dependencies>
</project>
2.2 编译
mvn install:install-file -Dfile=/path/to/java-memcached-release_2.6.2.jar -DgroupId=com.danga -DartifactId=memcached -Dversion=2.6.2 -Dpackaging=jar -DgeneratePom=true
2.3 添加依赖到项目
<dependency>
<groupId>com.danga</groupId>
<artifactId>memcached</artifactId>
<version>2.6.2</version>
</dependency>