Hadoop Java-Maven使用Jedis操作Redis

增加代码

import redis.clients.jedis.Jedis;
...
Jedis jedis = new Jedis("192.168.1.1", 6340);
jedis.set(outputKey,"1");

增加pom.xml

具体内容取自http://maven.aliyun.com/nexus/#welcome

    <dependency>
      <groupId>org.yatech.jedis</groupId>
      <artifactId>jedis-utils</artifactId>
      <version>0.5.0</version>
      <type>pom</type>
    </dependency>

mvn install后,如果需要在其他机器执行,编译出的jar包需要携带jedis-2.7.0.jar
使用WinRAR打开jar包,新建lib文件夹,将jedis-2.7.0.jar拖入lib