Skip to content

Commit 14b4edc

Browse files
authored
Merge pull request #8 from RedisLabs/mvn-publish
update pom.xml to publish to mvn repository
2 parents 9abda43 + 4a56d1e commit 14b4edc

File tree

3 files changed

+159
-107
lines changed

3 files changed

+159
-107
lines changed

README.md

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.redislabs/jrejson/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.redislabs/jrejson)
2+
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
3+
14
# JReJSON
25

36
A Java Client Library for [ReJSON](https://github.com/redislabsmodules/rejson)
@@ -8,13 +11,45 @@ This client provides access to ReJSON's Redis API, and provides back-and-forth s
811

912
This project is currently WIP and the interface may change. Also note that only the core ReJSON commands are supported at the moment.
1013

11-
## Installation
1214

13-
1. Install Jedis (once v3 is released this step will be obsolete)
14-
1. Clone it: `git clone --depth 1 git@github.com:xetorthio/jedis.git`
15-
2. `cd jedis`
16-
3. `mvn clean install -Dmaven.test.skip=true`
17-
2. Install JReJSON (todo: add to maven)
15+
16+
## Official Releases
17+
18+
```xml
19+
<dependencies>
20+
<dependency>
21+
<groupId>com.redislabs</groupId>
22+
<artifactId>jrejson</artifactId>
23+
<version>1.0.0</version>
24+
</dependency>
25+
</dependencies>
26+
```
27+
28+
### Snapshots
29+
30+
```xml
31+
<repositories>
32+
<repository>
33+
<id>snapshots-repo</id>
34+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
35+
</repository>
36+
</repositories>
37+
```
38+
39+
and
40+
41+
```xml
42+
<dependencies>
43+
<dependency>
44+
<groupId>com.redislabs</groupId>
45+
<artifactId>jrejson</artifactId>
46+
<version>1.0.1-SNAPSHOT</version>
47+
</dependency>
48+
</dependencies>
49+
```
50+
51+
52+
## Build
1853
1. Clone it: `git clone git@github.com:RedisLabs/JReJSON.git`
1954
2. `cd JReJSON`
2055
3. `mvn clean install -Dmaven.test.skip=true`

pom.xml

Lines changed: 104 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,51 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
~ BSD 2-Clause License
4-
~
5-
~ Copyright (c) 2017, Redis Labs
6-
~ All rights reserved.
7-
~
8-
~ Redistribution and use in source and binary forms, with or without
9-
~ modification, are permitted provided that the following conditions are met:
10-
~
11-
~ * Redistributions of source code must retain the above copyright notice, this
12-
~ list of conditions and the following disclaimer.
13-
~
14-
~ * Redistributions in binary form must reproduce the above copyright notice,
15-
~ this list of conditions and the following disclaimer in the documentation
16-
~ and/or other materials provided with the distribution.
17-
~
18-
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
~ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
~ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
~ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
~ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
~ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
~ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
~ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
~ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
~ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-
-->
292
<project xmlns="http://maven.apache.org/POM/4.0.0"
303
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
314
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
325
<modelVersion>4.0.0</modelVersion>
336

347
<groupId>com.redislabs</groupId>
358
<artifactId>jrejson</artifactId>
36-
<version>1.0.0-SNAPSHOT</version>
37-
<name>jrejson</name>
9+
<version>1.0.0</version>
10+
11+
<name>JReJSON</name>
12+
<description>Official client for ReJSON</description>
13+
<url>https://oss.redislabs.com/rejson</url>
3814

15+
<organization>
16+
<name>RedisLabs</name>
17+
<url>www.redislabs.com</url>
18+
</organization>
19+
<issueManagement>
20+
<system>github</system>
21+
<url>https://github.com/RedisLabs/JReJSON/issues</url>
22+
</issueManagement>
23+
<scm>
24+
<connection>scm:git:git@github.com:RedisLabs/JReJSON.git</connection>
25+
<url>scm:git:git@github.com:RedisLabs/JReJSON.git</url>
26+
<developerConnection>scm:git:git@github.com:RedisLabs/JReJSON.git</developerConnection>
27+
<tag>1.0.0</tag>
28+
</scm>
3929
<developers>
4030
<developer>
4131
<name>Itamar Haber</name>
4232
<organization>redislabs</organization>
4333
<organizationUrl>https://redislabs.com/</organizationUrl>
4434
</developer>
4535
</developers>
46-
47-
<scm>
48-
<connection>scm:git:git@github.com:RedisLabs/JReJSON.git</connection>
49-
<url>scm:git:git@github.com:RedisLabs/JReJSON.git</url>
50-
<developerConnection>scm:git:git@github.com:RedisLabs/JReJSON.git</developerConnection>
51-
<tag>1.0.0</tag>
52-
</scm>
53-
54-
<issueManagement>
55-
<system>github</system>
56-
<url>https://github.com/RedisLabs/JReJSON/issues</url>
57-
</issueManagement>
58-
36+
<licenses>
37+
<license>
38+
<name>BSD 2 Clause</name>
39+
<url>https://opensource.org/licenses/BSD-2-Clause</url>
40+
<distribution>repo</distribution>
41+
</license>
42+
</licenses>
5943
<properties>
6044
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6145
<maven.compiler.source>1.8</maven.compiler.source>
6246
<maven.compiler.target>1.8</maven.compiler.target>
47+
<maven.test.source>8</maven.test.source>
48+
<maven.test.target>8</maven.test.target>
6349
<gson.version>2.8.0</gson.version>
6450
<jedis.version>3.0.0-SNAPSHOT</jedis.version>
6551
<commons.pool2.version>2.4.2</commons.pool2.version>
@@ -81,7 +67,6 @@
8167
<artifactId>commons-pool2</artifactId>
8268
<version>${commons.pool2.version}</version>
8369
</dependency>
84-
<!-- test -->
8570
<dependency>
8671
<groupId>junit</groupId>
8772
<artifactId>junit</artifactId>
@@ -90,60 +75,92 @@
9075
</dependency>
9176
</dependencies>
9277

78+
<distributionManagement>
79+
<snapshotRepository>
80+
<id>ossrh</id>
81+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
82+
</snapshotRepository>
83+
<repository>
84+
<id>ossrh</id>
85+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
86+
</repository>
87+
</distributionManagement>
88+
9389
<build>
9490
<plugins>
9591
<plugin>
96-
<groupId>org.apache.maven.plugins</groupId>
97-
<artifactId>maven-jar-plugin</artifactId>
98-
<version>2.6</version>
99-
</plugin>
100-
<plugin>
101-
<groupId>org.apache.maven.plugins</groupId>
10292
<artifactId>maven-compiler-plugin</artifactId>
103-
<version>2.0.2</version>
93+
<version>3.0</version>
10494
<configuration>
10595
<source>${maven.compiler.source}</source>
10696
<target>${maven.compiler.target}</target>
10797
<encoding>${project.build.sourceEncoding}</encoding>
10898
</configuration>
10999
</plugin>
110100
<plugin>
111-
<groupId>org.apache.maven.plugins</groupId>
112-
<artifactId>maven-resources-plugin</artifactId>
113-
<version>2.6</version>
114-
<configuration>
115-
<encoding>${project.build.sourceEncoding}</encoding>
116-
</configuration>
117-
</plugin>
118-
<plugin>
119-
<groupId>org.apache.maven.plugins</groupId>
120-
<artifactId>maven-javadoc-plugin</artifactId>
121-
<version>2.10.3</version>
122-
<configuration>
123-
<encoding>${project.build.sourceEncoding}</encoding>
124-
</configuration>
125-
<executions>
126-
<execution>
127-
<phase>package</phase>
128-
<goals>
129-
<goal>jar</goal>
130-
</goals>
131-
</execution>
132-
</executions>
133-
</plugin>
134-
<plugin>
135-
<groupId>org.apache.maven.plugins</groupId>
136-
<artifactId>maven-source-plugin</artifactId>
137-
<version>3.0.0</version>
138-
<executions>
139-
<execution>
140-
<id>attach-sources</id>
141-
<goals>
142-
<goal>jar</goal>
143-
</goals>
144-
</execution>
145-
</executions>
146-
</plugin>
101+
<groupId>org.sonatype.plugins</groupId>
102+
<artifactId>nexus-staging-maven-plugin</artifactId>
103+
<version>1.6.7</version>
104+
<extensions>true</extensions>
105+
<configuration>
106+
<serverId>ossrh</serverId>
107+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
108+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
109+
</configuration>
110+
</plugin>
111+
147112
</plugins>
148113
</build>
149-
</project>
114+
<profiles>
115+
<profile>
116+
<id>release</id>
117+
<build>
118+
<plugins>
119+
<!--Include sources and docs -->
120+
<plugin>
121+
<groupId>org.apache.maven.plugins</groupId>
122+
<artifactId>maven-source-plugin</artifactId>
123+
<version>2.2.1</version>
124+
<executions>
125+
<execution>
126+
<id>attach-sources</id>
127+
<goals>
128+
<goal>jar-no-fork</goal>
129+
</goals>
130+
</execution>
131+
</executions>
132+
</plugin>
133+
<plugin>
134+
<groupId>org.apache.maven.plugins</groupId>
135+
<artifactId>maven-javadoc-plugin</artifactId>
136+
<version>2.9.1</version>
137+
<executions>
138+
<execution>
139+
<id>attach-javadocs</id>
140+
<goals>
141+
<goal>jar</goal>
142+
</goals>
143+
</execution>
144+
</executions>
145+
</plugin>
146+
147+
<!--Sign the components - this is required by maven central for releases -->
148+
<plugin>
149+
<groupId>org.apache.maven.plugins</groupId>
150+
<artifactId>maven-gpg-plugin</artifactId>
151+
<version>1.5</version>
152+
<executions>
153+
<execution>
154+
<id>sign-artifacts</id>
155+
<phase>verify</phase>
156+
<goals>
157+
<goal>sign</goal>
158+
</goals>
159+
</execution>
160+
</executions>
161+
</plugin>
162+
</plugins>
163+
</build>
164+
</profile>
165+
</profiles>
166+
</project>

src/main/java/com/redislabs/modules/rejson/JReJSON.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import com.google.gson.Gson;
3232
import redis.clients.jedis.Jedis;
3333
import redis.clients.jedis.commands.ProtocolCommand;
34-
import redis.clients.util.SafeEncoder;
34+
import redis.clients.jedis.util.SafeEncoder;
3535

3636
import java.util.ArrayList;
3737
import java.util.List;
@@ -128,9 +128,9 @@ public static Long del(Jedis conn, String key, Path... path) {
128128
args.add(SafeEncoder.encode(key));
129129
args.add(SafeEncoder.encode(getSingleOptionalPath(path).toString()));
130130

131-
Long rep = conn.getClient()
132-
.sendCommand(Command.DEL, args.toArray(new byte[args.size()][]))
133-
.getIntegerReply();
131+
conn.getClient()
132+
.sendCommand(Command.DEL, args.toArray(new byte[args.size()][]));
133+
Long rep = conn.getClient().getIntegerReply();
134134
conn.close();
135135

136136
return rep;
@@ -152,9 +152,9 @@ public static Object get(Jedis conn, String key, Path... paths) {
152152
args.add(SafeEncoder.encode(p.toString()));
153153
}
154154

155-
String rep = conn.getClient()
156-
.sendCommand(Command.GET, args.toArray(new byte[args.size()][]))
157-
.getBulkReply();
155+
conn.getClient()
156+
.sendCommand(Command.GET, args.toArray(new byte[args.size()][]));
157+
String rep = conn.getClient().getBulkReply();
158158
conn.close();
159159

160160
assertReplyNotError(rep);
@@ -180,9 +180,9 @@ public static void set(Jedis conn, String key, Object object, ExistenceModifier
180180
args.add(flag.getRaw());
181181
}
182182

183-
String status = conn.getClient()
184-
.sendCommand(Command.SET, args.toArray(new byte[args.size()][]))
185-
.getStatusCodeReply();
183+
conn.getClient()
184+
.sendCommand(Command.SET, args.toArray(new byte[args.size()][]));
185+
String status = conn.getClient().getStatusCodeReply();
186186
conn.close();
187187

188188
assertReplyOK(status);
@@ -198,7 +198,7 @@ public static void set(Jedis conn, String key, Object object, ExistenceModifier
198198
public static void set(Jedis conn, String key, Object object, Path... path) {
199199
set(conn,key, object, ExistenceModifier.DEFAULT, path);
200200
}
201-
201+
202202
/**
203203
* Gets the class of an object
204204
* @param conn the Jedis connection
@@ -213,9 +213,9 @@ public static Class<?> type(Jedis conn, String key, Path... path) {
213213
args.add(SafeEncoder.encode(key));
214214
args.add(SafeEncoder.encode(getSingleOptionalPath(path).toString()));
215215

216-
String rep = conn.getClient()
217-
.sendCommand(Command.TYPE, args.toArray(new byte[args.size()][]))
218-
.getBulkReply();
216+
conn.getClient()
217+
.sendCommand(Command.TYPE, args.toArray(new byte[args.size()][]));
218+
String rep = conn.getClient().getBulkReply();
219219
conn.close();
220220

221221
assertReplyNotError(rep);

0 commit comments

Comments
 (0)