Memcached Maven Install

Memcached Maven Install

摘要

Memcached Maven Install , Memcached Maven 安装在本地

Memcached java客户端

这里使用的是 https://github.com/gwhalin/Memcached-Java-Client
因为Memcached-Java-Client没有发布在maven仓库里,所以我们要用maven的install命令手动安装

Memcached Maven安装

jar包下载地址 https://github.com/gwhalin/Memcached-Java-Client/downloads

比如我们选用 2.6.2 版本,下载地址是https://github.com/downloads/gwhalin/Memcached-Java-Client/java_memcached-release_2.6.2.zip

解压后,创建pom文件用以描述这个要被安装的jar

<?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.memcached</groupId>
    <artifactId>java_memcached-release</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>

然后在当前目录执行如下命令就安装好了
mvn install:install-file -Dfile=java_memcached-release_2.6.2.jar -DpomFile=java-memcached-2.6.2.pom

如何引用这个jar

<dependency>  
    <groupId>com.memcached</groupId>
    <artifactId>java_memcached-release</artifactId>
    <version>2.6.2</version>
</dependency>