Skip to content

Commit 9945a56

Browse files
committed
Issue #790 split up ditto-json and ditto-json-cbor
* in order to get ditto-json w/o dependencies to Jackson running in OSGi environments, it is required to do a split and move CBOR related functionalities to another module * abstraction is done via a java.util.ServiceLoader * application of the ServiceLoader in OSGi is not ensured or tested as we don't assume that someone wants to use CBOR backed serialization when e.g. using the Java Ditto-Client * some "breaking" changes to ditto-json can be tolerated as the affected APIs can be treated as "Ditto backend internal" APIs required to apply CBOR serialization Signed-off-by: Thomas Jaeckle <[email protected]> (cherry picked from commit edfdba3)
1 parent 060e0f8 commit 9945a56

File tree

52 files changed

+1338
-799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1338
-799
lines changed

json-cbor/pom.xml

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright (c) 2020 Contributors to the Eclipse Foundation
4+
~
5+
~ See the NOTICE file(s) distributed with this work for additional
6+
~ information regarding copyright ownership.
7+
~
8+
~ This program and the accompanying materials are made available under the
9+
~ terms of the Eclipse Public License 2.0 which is available at
10+
~ http://www.eclipse.org/legal/epl-2.0
11+
~
12+
~ SPDX-License-Identifier: EPL-2.0
13+
-->
14+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
15+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
16+
<modelVersion>4.0.0</modelVersion>
17+
18+
<parent>
19+
<groupId>org.eclipse.ditto</groupId>
20+
<artifactId>ditto-bom</artifactId>
21+
<version>${revision}</version>
22+
<relativePath>../bom</relativePath>
23+
</parent>
24+
25+
<artifactId>ditto-json-cbor</artifactId>
26+
<packaging>bundle</packaging>
27+
<name>Eclipse Ditto :: JSON :: CBOR</name>
28+
29+
<properties>
30+
<javac.source>1.8</javac.source>
31+
<javac.target>1.8</javac.target>
32+
</properties>
33+
34+
<dependencies>
35+
<!-- ### Compile ### -->
36+
<dependency>
37+
<groupId>org.eclipse.ditto</groupId>
38+
<artifactId>ditto-json</artifactId>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>com.fasterxml.jackson.core</groupId>
43+
<artifactId>jackson-core</artifactId>
44+
</dependency>
45+
<dependency>
46+
<groupId>com.fasterxml.jackson.dataformat</groupId>
47+
<artifactId>jackson-dataformat-cbor</artifactId>
48+
</dependency>
49+
50+
<!-- ### Provided ### -->
51+
<dependency>
52+
<groupId>com.google.code.findbugs</groupId>
53+
<artifactId>jsr305</artifactId>
54+
<scope>provided</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.eclipse.ditto</groupId>
58+
<artifactId>ditto-utils-jsr305</artifactId>
59+
<scope>provided</scope>
60+
</dependency>
61+
62+
<!-- ### Testing ### -->
63+
<dependency>
64+
<groupId>junit</groupId>
65+
<artifactId>junit</artifactId>
66+
<scope>test</scope>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.assertj</groupId>
70+
<artifactId>assertj-core</artifactId>
71+
<scope>test</scope>
72+
</dependency>
73+
</dependencies>
74+
75+
<build>
76+
<plugins>
77+
<plugin>
78+
<groupId>org.codehaus.mojo</groupId>
79+
<artifactId>flatten-maven-plugin</artifactId>
80+
<configuration>
81+
<flattenMode>ossrh</flattenMode>
82+
</configuration>
83+
</plugin>
84+
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-javadoc-plugin</artifactId>
88+
<configuration>
89+
<source>8</source>
90+
</configuration>
91+
</plugin>
92+
93+
<plugin>
94+
<groupId>com.github.siom79.japicmp</groupId>
95+
<artifactId>japicmp-maven-plugin</artifactId>
96+
<configuration>
97+
<skip>true</skip> <!-- TODO skip until Ditto 1.3.0 release -->
98+
<parameter>
99+
<excludes>
100+
<!-- Don't add excludes here before checking with the whole Ditto team -->
101+
<!--<exclude></exclude>-->
102+
</excludes>
103+
</parameter>
104+
</configuration>
105+
</plugin>
106+
107+
<plugin>
108+
<groupId>org.apache.felix</groupId>
109+
<artifactId>maven-bundle-plugin</artifactId>
110+
<extensions>true</extensions>
111+
<configuration>
112+
<instructions>
113+
<Export-Package>org.eclipse.ditto.json.cbor</Export-Package>
114+
<Import-Package>
115+
org.eclipse.ditto.json,
116+
com.fasterxml.jackson.*
117+
</Import-Package>
118+
</instructions>
119+
</configuration>
120+
</plugin>
121+
</plugins>
122+
</build>
123+
124+
</project>

json/src/main/java/org/eclipse/ditto/json/BinaryToHexConverter.java json-cbor/src/main/java/org/eclipse/ditto/json/cbor/BinaryToHexConverter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 Contributors to the Eclipse Foundation
2+
* Copyright (c) 2020 Contributors to the Eclipse Foundation
33
*
44
* See the NOTICE file(s) distributed with this work for additional
55
* information regarding copyright ownership.
@@ -10,7 +10,7 @@
1010
*
1111
* SPDX-License-Identifier: EPL-2.0
1212
*/
13-
package org.eclipse.ditto.json;
13+
package org.eclipse.ditto.json.cbor;
1414

1515
import java.io.ByteArrayInputStream;
1616
import java.io.IOException;
@@ -20,7 +20,7 @@
2020
/**
2121
* Helper for converting binary data to an uppercase hexadecimal string for debugging and logging purposes.
2222
*
23-
* @since 1.1.0
23+
* @since 1.2.1
2424
*/
2525
public final class BinaryToHexConverter {
2626

json/src/main/java/org/eclipse/ditto/json/ByteBufferInputStream.java json-cbor/src/main/java/org/eclipse/ditto/json/cbor/ByteBufferInputStream.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 Contributors to the Eclipse Foundation
2+
* Copyright (c) 2020 Contributors to the Eclipse Foundation
33
*
44
* See the NOTICE file(s) distributed with this work for additional
55
* information regarding copyright ownership.
@@ -10,7 +10,7 @@
1010
*
1111
* SPDX-License-Identifier: EPL-2.0
1212
*/
13-
package org.eclipse.ditto.json;
13+
package org.eclipse.ditto.json.cbor;
1414

1515
import java.io.ByteArrayInputStream;
1616
import java.io.InputStream;

json/src/main/java/org/eclipse/ditto/json/ByteBufferOutputStream.java json-cbor/src/main/java/org/eclipse/ditto/json/cbor/ByteBufferOutputStream.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 Contributors to the Eclipse Foundation
2+
* Copyright (c) 2020 Contributors to the Eclipse Foundation
33
*
44
* See the NOTICE file(s) distributed with this work for additional
55
* information regarding copyright ownership.
@@ -10,13 +10,13 @@
1010
*
1111
* SPDX-License-Identifier: EPL-2.0
1212
*/
13-
package org.eclipse.ditto.json;
13+
package org.eclipse.ditto.json.cbor;
1414

1515
import java.io.OutputStream;
1616
import java.nio.ByteBuffer;
1717

1818
/**
19-
* Implementation of {@link java.io.InputStream} backed by a {@link ByteBuffer}.
19+
* Implementation of {@link OutputStream} backed by a {@link ByteBuffer}.
2020
*/
2121
final class ByteBufferOutputStream extends OutputStream {
2222

0 commit comments

Comments
 (0)