Skip to content

Commit 0de0cdd

Browse files
authored
Merge branch 'master' into 2.0.0-RC1
2 parents 28a6987 + 87bafc0 commit 0de0cdd

File tree

370 files changed

+30094
-151
lines changed

Some content is hidden

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

370 files changed

+30094
-151
lines changed

.github/workflows/maven.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#
2+
# Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Eclipse Public License v. 2.0, which is available at
6+
# http://www.eclipse.org/legal/epl-2.0.
7+
#
8+
# This Source Code may also be made available under the following Secondary
9+
# Licenses when the conditions for such availability set forth in the
10+
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11+
# version 2 with the GNU Classpath Exception, which is available at
12+
# https://www.gnu.org/software/classpath/license.html.
13+
#
14+
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
#
16+
17+
name: JSON-B API
18+
19+
on: [push, pull_request]
20+
21+
jobs:
22+
build:
23+
name: JSON-B API compilation
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout for build
28+
uses: actions/checkout@v2.3.4
29+
with:
30+
fetch-depth: 0
31+
- name: Set up compile JDK
32+
uses: actions/setup-java@v2
33+
with:
34+
distribution: 'adopt'
35+
java-version: 11
36+
- name: Maven cache
37+
uses: actions/cache@v2
38+
env:
39+
cache-name: maven-cache
40+
with:
41+
path:
42+
~/.m2
43+
key: build-${{ env.cache-name }}
44+
- name: API compilation
45+
run: cd api && mvn clean install
46+
- name: TCK test compilation
47+
run: cd tck && mvn clean install
48+
- name: Javadoc compilation
49+
run: cd docs && mvn clean install
50+
- name: Generating specification
51+
run: cd spec && mvn clean install

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Maven Central](https://img.shields.io/maven-central/v/jakarta.json.bind/jakarta.json.bind-api.svg?label=Maven%20Central)](https://mvnrepository.com/artifact/jakarta.json.bind/jakarta.json.bind-api)
44
[![Javadoc](https://javadoc.io/badge2/jakarta.json.bind/jakarta.json.bind-api/javadoc.io.svg)](https://javadoc.io/doc/jakarta.json.bind/jakarta.json.bind-api)
5-
[![Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/jakarta.json.bind/jakarta.json.bind-api.svg?label=Snapshots)](https://oss.sonatype.org/content/repositories/snapshots/jakarta/json/bind/jakarta.json.bind-api/)
5+
[![Snapshots](https://img.shields.io/nexus/s/https/jakarta.oss.sonatype.org/jakarta.json.bind/jakarta.json.bind-api.svg?label=Snapshots)](https://jakarta.oss.sonatype.org/content/repositories/staging/jakarta/json/bind/jakarta.json.bind-api/)
66
[![Gitter](https://badges.gitter.im/eclipse/jsonb.svg)](https://gitter.im/eclipse/jsonb)
77
[![License](https://img.shields.io/badge/License-EPL%202.0-green.svg)](https://opensource.org/licenses/EPL-2.0)
88

@@ -16,7 +16,7 @@ JSON-B is a standard binding layer for converting Java objects to/from JSON mess
1616
<dependency>
1717
<groupId>jakarta.json.bind</groupId>
1818
<artifactId>jakarta.json.bind-api</artifactId>
19-
<version>1.0.1</version>
19+
<version>2.0.0</version>
2020
</dependency>
2121
```
2222

@@ -52,11 +52,16 @@ String aliceJson = "{\"id\":5678,\"name\":\"Alice\",\"age\":42}";
5252
User alice = jsonb.fromJson(aliceJson, User.class);
5353
```
5454

55+
## How to run the TCK tests
56+
57+
The JSON-B TCK tests are produced as a Maven artifact where the tests use Arquillian + JUnit. To run the TCK tests using your implementation,
58+
include the TCK module and apply the appropriate Arquillian container. See the [Eclipse Yasson](https://github.com/eclipse-ee4j/yasson) repository for an example of this.
59+
5560
## Links
5661

5762
- [Official web site](https://eclipse-ee4j.github.io/jsonb-api)
5863
- [Eclipse project](https://projects.eclipse.org/projects/ee4j.jsonb)
59-
- [User's Guide](http://json-b.net/docs/user-guide.html)
64+
- [User's Guide](https://eclipse-ee4j.github.io/jsonb-api/docs/user-guide.html)
6065
- [Jenkins Builds](https://ci.eclipse.org/jsonb/view/all/)
6166
- [Mailing list](https://www.eclipse.org/lists/jsonb-dev/)
6267
- [Yasson (Compatible Implementation)](https://github.com/eclipse-ee4j/yasson)

api/pom.xml

Lines changed: 36 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -23,12 +23,12 @@
2323
<parent>
2424
<groupId>org.eclipse.ee4j</groupId>
2525
<artifactId>project</artifactId>
26-
<version>1.0.6</version>
26+
<version>1.0.7</version>
2727
</parent>
2828

2929
<groupId>jakarta.json.bind</groupId>
3030
<artifactId>jakarta.json.bind-api</artifactId>
31-
<version>2.0.1-SNAPSHOT</version>
31+
<version>3.0.0-SNAPSHOT</version>
3232
<packaging>jar</packaging>
3333

3434
<name>JSON-B API</name>
@@ -86,11 +86,13 @@
8686
<release.spec.feedback>jsonb-dev@eclipse.org</release.spec.feedback>
8787
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
8888
<milestone.number>01</milestone.number>
89-
<new.spec.version>1.1.0</new.spec.version>
89+
<new.spec.version>3.0.0</new.spec.version>
9090
<non.final>false</non.final>
9191
<skip.release.tests>false</skip.release.tests>
92-
<spec.version>1.1</spec.version>
93-
<jakarta.json.version>2.0.0-RC1</jakarta.json.version>
92+
<spec.version>3.0</spec.version>
93+
<jakarta.json.version>2.0.1</jakarta.json.version>
94+
<!-- The version of JSON-B API to compare against to verify we follow semantic versioning rules -->
95+
<baseline.compare.version>2.0.0</baseline.compare.version>
9496
<api_package>jakarta.json.bind</api_package>
9597
<legal.doc.source>${project.basedir}/..</legal.doc.source>
9698
<vendor.name>Oracle Corporation</vendor.name>
@@ -106,7 +108,7 @@
106108
<dependency>
107109
<groupId>junit</groupId>
108110
<artifactId>junit</artifactId>
109-
<version>4.12</version>
111+
<version>4.13.1</version>
110112
<scope>test</scope>
111113
</dependency>
112114
</dependencies>
@@ -125,57 +127,6 @@
125127
</dependencies>
126128

127129
<profiles>
128-
<profile>
129-
<id>jdk11</id>
130-
<activation>
131-
<jdk>[11,)</jdk>
132-
</activation>
133-
<build>
134-
<plugins>
135-
<plugin>
136-
<groupId>org.apache.maven.plugins</groupId>
137-
<artifactId>maven-compiler-plugin</artifactId>
138-
<executions>
139-
<execution>
140-
<id>jdk-11</id>
141-
<goals>
142-
<goal>compile</goal>
143-
</goals>
144-
<configuration>
145-
<source>9</source>
146-
<target>9</target>
147-
<includes>
148-
<include>module-info.java</include>
149-
</includes>
150-
</configuration>
151-
</execution>
152-
</executions>
153-
</plugin>
154-
</plugins>
155-
</build>
156-
</profile>
157-
<profile>
158-
<id>jdk8</id>
159-
<activation>
160-
<jdk>(,9)</jdk>
161-
</activation>
162-
<build>
163-
<plugins>
164-
<plugin>
165-
<groupId>org.apache.maven.plugins</groupId>
166-
<artifactId>maven-checkstyle-plugin</artifactId>
167-
</plugin>
168-
<plugin>
169-
<groupId>org.codehaus.mojo</groupId>
170-
<artifactId>findbugs-maven-plugin</artifactId>
171-
</plugin>
172-
<plugin>
173-
<groupId>org.apache.maven.plugins</groupId>
174-
<artifactId>maven-javadoc-plugin</artifactId>
175-
</plugin>
176-
</plugins>
177-
</build>
178-
</profile>
179130
<profile>
180131
<id>final</id>
181132
<activation>
@@ -250,34 +201,8 @@
250201
<compilerArgs>
251202
<arg>-Xlint:all</arg>
252203
</compilerArgs>
204+
<release>11</release>
253205
</configuration>
254-
<executions>
255-
<execution>
256-
<id>default-compile</id>
257-
<configuration>
258-
<release>11</release>
259-
</configuration>
260-
</execution>
261-
<execution>
262-
<id>base-compile</id>
263-
<goals>
264-
<goal>compile</goal>
265-
</goals>
266-
<!-- recompile everything for 1.8 except the module-info.java -->
267-
<configuration>
268-
<release>8</release>
269-
<excludes>
270-
<exclude>module-info.java</exclude>
271-
</excludes>
272-
</configuration>
273-
</execution>
274-
<execution>
275-
<id>default-testCompile</id>
276-
<configuration>
277-
<release>11</release>
278-
</configuration>
279-
</execution>
280-
</executions>
281206
</plugin>
282207
<plugin>
283208
<!-- This plugin generates the buildNumber property used in maven-bundle-plugin -->
@@ -346,7 +271,7 @@
346271
<Specification-Version>${spec.specification.version}</Specification-Version>
347272
<Specification-Vendor>${vendor.name}</Specification-Vendor>
348273
<_nodefaultversion>false</_nodefaultversion>
349-
<Export-Package>javax.json.bind.*; version=${spec.version}</Export-Package>
274+
<Export-Package>jakarta.json.bind.*; version=${spec.version}</Export-Package>
350275
<_noee>true</_noee>
351276
</instructions>
352277
</configuration>
@@ -375,23 +300,23 @@
375300
<artifactId>maven-javadoc-plugin</artifactId>
376301
<version>3.1.0</version>
377302
<configuration>
378-
<source>8</source>
303+
<source>11</source>
379304
<doctitle>Jakarta JSON Binding ${project.version} API Specification</doctitle>
380305
<sourceFileExcludes>
381306
<sourceFileExclude>**/module-info.java</sourceFileExclude>
382307
<sourceFileExclude>target/**/*.java</sourceFileExclude>
383308
</sourceFileExcludes>
384309
<docfilessubdirs>true</docfilessubdirs>
385310
<links>
386-
<link>http://docs.oracle.com/javase/8/docs/api/</link>
311+
<link>http://docs.oracle.com/en/java/javase/11/docs/api/</link>
387312
</links>
388313
<detectJavaApiLink>false</detectJavaApiLink>
389314
<detectOfflineLinks>false</detectOfflineLinks>
390315
<header><![CDATA[<br>Jakarta JSON Binding API v${project.version}]]>
391316
</header>
392317
<bottom><![CDATA[
393318
Comments to: <a href="mailto:${release.spec.feedback}">${release.spec.feedback}</a>.<br>
394-
Copyright &#169; 2019 Eclipse Foundation. All Rights Reserved.<br>
319+
Copyright &#169; 2019, 2021 Eclipse Foundation. All Rights Reserved.<br>
395320
Use is subject to <a href="{@docRoot}/doc-files/EFSL.html" target="_top">license terms</a>.]]>
396321
</bottom>
397322
</configuration>
@@ -433,16 +358,12 @@
433358
<plugin>
434359
<groupId>org.glassfish.copyright</groupId>
435360
<artifactId>glassfish-copyright-maven-plugin</artifactId>
436-
<version>1.50</version>
361+
<version>2.4</version>
437362
<configuration>
438363
<excludeFile>${basedir}/../etc/config/copyright-exclude</excludeFile>
439-
<!--svn|mercurial|git - defaults to svn-->
440364
<scm>git</scm>
441-
<!-- turn on/off debugging -->
442365
<debug>false</debug>
443-
<!-- skip files not under SCM-->
444366
<scmOnly>true</scmOnly>
445-
<!-- turn off warnings -->
446367
<warn>false</warn>
447368
<!-- for use with repair -->
448369
<update>false</update>
@@ -454,6 +375,7 @@
454375
<executions>
455376
<execution>
456377
<goals>
378+
<goal>copyright</goal>
457379
<goal>check</goal>
458380
</goals>
459381
<phase>compile</phase>
@@ -468,7 +390,7 @@
468390
<dependency>
469391
<groupId>com.puppycrawl.tools</groupId>
470392
<artifactId>checkstyle</artifactId>
471-
<version>8.18</version>
393+
<version>8.29</version>
472394
</dependency>
473395
</dependencies>
474396
<configuration>
@@ -552,6 +474,25 @@
552474
<groupId>org.glassfish.build</groupId>
553475
<artifactId>spec-version-maven-plugin</artifactId>
554476
</plugin>
477+
<!-- Ensures that we follow semantic versioning rules -->
478+
<plugin>
479+
<groupId>biz.aQute.bnd</groupId>
480+
<artifactId>bnd-baseline-maven-plugin</artifactId>
481+
<version>6.0.0</version>
482+
<configuration>
483+
<base>
484+
<version>${baseline.compare.version}</version>
485+
</base>
486+
</configuration>
487+
<executions>
488+
<execution>
489+
<id>baseline</id>
490+
<goals>
491+
<goal>baseline</goal>
492+
</goals>
493+
</execution>
494+
</executions>
495+
</plugin>
555496
</plugins>
556497
</build>
557498

api/src/main/java/jakarta/json/bind/Jsonb.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2021 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -260,7 +260,8 @@ public interface Jsonb extends AutoCloseable {
260260
* The root object of the object content tree to be serialized. Must not be null.
261261
*
262262
* @param runtimeType
263-
* Runtime type of the content tree's root object.
263+
* Runtime type of the content tree's root object. Provided type needs to be
264+
* related to the type of the instance.
264265
*
265266
* @return String instance with serialized JSON data.
266267
*
@@ -298,7 +299,8 @@ public interface Jsonb extends AutoCloseable {
298299
* The object content tree to be serialized.
299300
*
300301
* @param runtimeType
301-
* Runtime type of the content tree's root object.
302+
* Runtime type of the content tree's root object. Provided type needs to be
303+
* related to the type of the instance.
302304
*
303305
* @param writer
304306
* The JSON will be sent as a character stream to the given
@@ -339,7 +341,8 @@ public interface Jsonb extends AutoCloseable {
339341
* The object content tree to be serialized.
340342
*
341343
* @param runtimeType
342-
* Runtime type of the content tree's root object.
344+
* Runtime type of the content tree's root object. Provided type needs to be
345+
* related to the type of the instance.
343346
*
344347
* @param stream
345348
* The JSON will be sent as a byte stream to the given

0 commit comments

Comments
 (0)