memcached is used in maven projects

  Memcached is a high-performance distributed in-memory object caching system for dynamic web applications to reduce database load. It improves the speed of dynamic, database-driven websites by reducing the number of database reads by caching data and objects in memory. Memcached is based on a hashmap that stores key/value pairs. The daemon (daemon) is written in C, but the client can be written in any language and communicate with the daemon through the memcached protocol.

 

I continue to use my maven to organize the system. Of course, I also talked about how to use maven some time ago. Maybe memcached did not write a good article. The following article will make up for it.

 

When I was sorting out the system today, I found that my memcached was a jar under Baidu, and I went directly to this at home. Then I went to http://mvnrepository.com/ and   continued to look for it, but the results I found were all spring-simple. I looked at it and the results I wanted seemed to be different.

So what to do? Only put the memcached downloaded some time ago in the maven library and use the project to reference,

1: Download the version of memcached you want to use. Download memcached client

2: Put the java_memcached-release_2.6.6.jar file inside on the d drive (where you can put it)

3: cmd enters the command;

?
1
 

Then enter the D drive and enter the following command:

?
1
  D:\>mvn install:install-file -Dfile=d:/java_memcached-release_2. 6.6 .jar -DgroupId=com.danga -DartifactId=memcached -Dversion= 2.5 . 3  -Dpackaging=jar -DgeneratePom= true

I don't remember the parameters of the command from Baidu. Haha.

Then in your maven repository, you will see that there is a dange folder under the com package, open it and see if there is ok, the addition is successful.

4: Find the maven-metadata-local.xml file under \localRepository\com\danga\memcached

Change the words below

?
1
2
3
4
5
6
7
8
9
<groupId>com.danga</groupId>
   <artifactId>memcached</artifactId>
   <versioning>
     <release> 2.6 . 6 </release>
     <versions>
       <version> 2.6 . 6 </version>
     </versions>
     <lastUpdated> 20150628145446 </lastUpdated>
   </versioning>

 

变成 通用格式 放在项目的pom文件下面:

?
1
2
3
4
5
<dependency>
    <groupId>com.danga</groupId>
    <artifactId>memcached</artifactId>
    <version> 2.6 . 6 </version>
   </dependency>

然后保存一下 在maven libbraries下面就看到 memcached的jar包了 ok。

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326942332&siteId=291194637