Skip to content

Commit d802780

Browse files
committed
�ύredis
1 parent a79dce9 commit d802780

7 files changed

Lines changed: 140 additions & 94 deletions

File tree

common/pom.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
44
<modelVersion>4.0.0</modelVersion>
55
<parent>
6-
<artifactId>xf-base</artifactId>
6+
<artifactId>base</artifactId>
77
<groupId>com.xf</groupId>
8-
<version>1.0.0</version>
8+
<version>1.0-SNAPSHOT</version>
99
</parent>
10-
<groupId>com.xf</groupId>
10+
<groupId>com.xf.base</groupId>
1111
<artifactId>common</artifactId>
12-
<version>1.0.0</version>
1312
<name>common</name>
1413
<url>http://maven.apache.org</url>
1514
<properties>

pom.xml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
<modelVersion>4.0.0</modelVersion>
44

55
<groupId>com.xf</groupId>
6-
<artifactId>xf-base</artifactId>
7-
<version>1.0.0</version>
6+
<artifactId>base</artifactId>
7+
<version>1.0-SNAPSHOT</version>
88
<packaging>pom</packaging>
99

10-
<name>xf-base</name>
10+
<name>base</name>
1111
<url>http://maven.apache.org</url>
1212
<properties>
1313
<junit.version>4.11</junit.version>
1414
<rabbitmq.version>1.3.0</rabbitmq.version>
15+
<jedis.version>2.1.0</jedis.version>
1516
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1617
</properties>
1718

@@ -26,6 +27,12 @@
2627
<artifactId>rabbitmq-client</artifactId>
2728
<version>${rabbitmq.version}</version>
2829
</dependency>
30+
<dependency>
31+
<groupId>redis.clients</groupId>
32+
<artifactId>jedis</artifactId>
33+
<version>${jedis.version}</version>
34+
</dependency>
35+
2936
</dependencies>
3037
<!--<repositories>
3138
<repository>
@@ -61,7 +68,7 @@
6168
<plugin>
6269
<groupId>org.apache.maven.plugins</groupId>
6370
<artifactId>maven-compiler-plugin</artifactId>
64-
<version>3.1</version>
71+
<version>2.3.2</version>
6572
<configuration>
6673
<source>${jdk.version}</source>
6774
<target>${jdk.version}</target>
@@ -102,7 +109,7 @@
102109
<version>1.8</version>
103110
</plugin>
104111

105-
<!-- cobertura 测试覆盖率统计插�-->
112+
<!-- cobertura 测试覆盖率统计插�?-->
106113
<plugin>
107114
<groupId>org.codehaus.mojo</groupId>
108115
<artifactId>cobertura-maven-plugin</artifactId>
@@ -152,7 +159,7 @@
152159
<version>2.4</version>
153160
</plugin>
154161

155-
<!-- enforcer插件, 避免被依赖的依赖引入过期的jar�-->
162+
<!-- enforcer插件, 避免被依赖的依赖引入过期的jar�?-->
156163
<plugin>
157164
<groupId>org.apache.maven.plugins</groupId>
158165
<artifactId>maven-enforcer-plugin</artifactId>

rabbitmq/pom.xml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,32 @@
44
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
7-
<artifactId>xf-base</artifactId>
8-
<groupId>com.xf</groupId>
9-
<version>1.0.0</version>
10-
</parent>
117
<groupId>com.xf</groupId>
8+
<artifactId>base</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
<groupId>com.xf.base</groupId>
1212
<artifactId>rabbitmq</artifactId>
13-
<version>1.0.0</version>
1413
<name>rabbitmq</name>
1514
<url>http://maven.apache.org</url>
1615
<properties>
1716
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18-
<junit.version>4.11</junit.version>
19-
<rabbitmq.version>1.3.0</rabbitmq.version>
20-
<amqp.version>3.0.4</amqp.version>
2117
</properties>
2218
<dependencies>
23-
<dependency>
24-
<groupId>junit</groupId>
25-
<artifactId>junit</artifactId>
26-
<version>${junit.version}</version>
27-
</dependency>
28-
<!-- <dependency>
29-
<groupId>com.rabbitmq</groupId>
30-
<artifactId>rabbitmq-client</artifactId>
31-
<version>${rabbitmq.version}</version>
32-
</dependency>-->
33-
<dependency>
34-
<groupId>com.rabbitmq</groupId>
35-
<artifactId>amqp-client</artifactId>
36-
<version>${amqp.version}</version>
19+
<dependency>
20+
<groupId>junit</groupId>
21+
<artifactId>junit</artifactId>
22+
<version>${junit.version}</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>com.rabbitmq</groupId>
26+
<artifactId>rabbitmq-client</artifactId>
27+
<version>${rabbitmq.version}</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>redis.clients</groupId>
31+
<artifactId>jedis</artifactId>
32+
<version>${jedis.version}</version>
3733
</dependency>
3834
</dependencies>
3935

redis/pom.xml

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
<?xml version="1.0"?>
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-
<parent>
6-
<groupId>com.xf</groupId>
7-
<artifactId>xf-base</artifactId>
8-
<version>1.0.0</version>
9-
</parent>
10-
<groupId>com.xf</groupId>
11-
<artifactId>redis</artifactId>
12-
<version>1.0.0</version>
13-
<name>redis</name>
14-
<url>http://maven.apache.org</url>
15-
<properties>
16-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17-
</properties>
18-
<dependencies>
19-
<dependency>
20-
<groupId>junit</groupId>
21-
<artifactId>junit</artifactId>
22-
<version>3.8.1</version>
23-
<scope>test</scope>
24-
</dependency>
25-
</dependencies>
2+
<project
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.xf</groupId>
8+
<artifactId>base</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
<groupId>com.xf.base</groupId>
12+
<artifactId>redis</artifactId>
13+
<name>redis</name>
14+
<url>http://maven.apache.org</url>
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
</properties>
18+
<dependencies>
19+
<dependency>
20+
<groupId>junit</groupId>
21+
<artifactId>junit</artifactId>
22+
<version>${junit.version}</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>redis.clients</groupId>
26+
<artifactId>jedis</artifactId>
27+
<version>${jedis.version}</version>
28+
</dependency>
29+
</dependencies>
2630
</project>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* @Title: RedisHello.java
3+
* @Package com.xf.redis.demo
4+
* @Description: TODO
5+
* @author xufei1 <[email protected]>
6+
* @date 2013-9-12 下午2:27:16
7+
* @version V1.0
8+
*
9+
* Modification History:
10+
* Date Author Version Description
11+
* --------------------------------------------------------------
12+
* 2013-9-12
13+
*/
14+
package com.xf.redis.demo;
15+
16+
import redis.clients.jedis.Jedis;
17+
18+
/**
19+
* <p></p>
20+
*
21+
* @author xufei1 <[email protected]>
22+
* Create at:2013-9-12 下午2:27:16
23+
*/
24+
public class RedisHello {
25+
private static final String ADDRESS = "10.100.54.31";
26+
/**
27+
*
28+
*
29+
* @param args
30+
*/
31+
32+
public static void main(String[] args) {
33+
Jedis jedis = new Jedis(ADDRESS);
34+
jedis.set("a", "Hello World !");
35+
String result = jedis.get("a");
36+
System.out.println("result:"+result);
37+
38+
}
39+
40+
}

redis/src/test/java/com/xf/AppTest.java

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* @Title: JedisTest.java
3+
* @Package com.xf.redis
4+
* @Description: TODO
5+
* @author xufei1 <[email protected]>
6+
* @date 2013-9-12 下午2:35:05
7+
* @version V1.0
8+
*
9+
* Modification History:
10+
* Date Author Version Description
11+
* --------------------------------------------------------------
12+
* 2013-9-12
13+
*/
14+
package com.xf.redis;
15+
16+
import org.junit.Test;
17+
18+
import redis.clients.jedis.Jedis;
19+
20+
import junit.framework.TestCase;
21+
22+
/**
23+
* <p>
24+
* </p>
25+
*
26+
* @author xufei1 <[email protected]> Create at:2013-9-12 下午2:35:05
27+
*/
28+
public class JedisTest {
29+
private static final String ADDRESS = "10.100.54.31";
30+
31+
@Test
32+
public void helloTest() {
33+
Jedis jedis = new Jedis(ADDRESS);
34+
jedis.set("a", "Hello World !");
35+
String result = jedis.get("a");
36+
System.out.println("result:" + result);
37+
}
38+
}

0 commit comments

Comments
 (0)