Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSSDK-8953] update non-code-path resources for FX #506

Merged
merged 4 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 93 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,99 +1,110 @@
Optimizely Java SDK
===================
# Optimizely Java SDK

[![Build Status](https://travis-ci.org/optimizely/java-sdk.svg?branch=master)](https://travis-ci.org/optimizely/java-sdk)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add coveralls badge if easy to do so, or create a follow-up story

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this new line is causing the two badges you current have to appear on two lines. Please remove so that they're all on the same line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add coveralls badge if easy to do so, or create a follow-up story

Coverall links disconnected for some SDKs including java. Let's review them all together. @russell-loube-optimizely

[![Apache 2.0](https://img.shields.io/badge/license-APACHE%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)

This repository houses the Java SDK for use with Optimizely Full Stack and Optimizely Rollouts.
This repository houses the Java SDK for use with Optimizely Feature Experimentation and Optimizely Full Stack (legacy).

Optimizely Full Stack is A/B testing and feature flag management for product development teams. Experiment in any application. Make every feature on your roadmap an opportunity to learn. Learn more at https://www.optimizely.com/platform/full-stack/, or see the [documentation](https://docs.developers.optimizely.com/experimentation/v4.0-full-stack/docs).
Optimizely Feature Experimentation is an A/B testing and feature management tool for product development teams that enables you to experiment at every step. Using Optimizely Feature Experimentation allows for every feature on your roadmap to be an opportunity to discover hidden insights. Learn more at [Optimizely.com](https://www.optimizely.com/products/experiment/feature-experimentation/), or see the [developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/welcome).

Optimizely Rollouts is free feature flags for development teams. Easily roll out and roll back features in any application without code deploys. Mitigate risk for every feature on your roadmap. Learn more at https://www.optimizely.com/rollouts/, or see the [documentation](https://docs.developers.optimizely.com/experimentation/v3.1.0-full-stack/docs/introduction-to-rollouts).
Optimizely Rollouts is [free feature flags](https://www.optimizely.com/free-feature-flagging/) for development teams. You can easily roll out and roll back features in any application without code deploys, mitigating risk for every feature on your roadmap.

## Get started

## Getting Started
Refer to the [Java SDK's developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/java-sdk) for detailed instructions on getting started with using the SDK.

### Installing the SDK
### Requirements

#### Gradle
Java 8 or higher versions.

The Java SDK is distributed through Maven Central and is created with source and target compatibility of Java 1.8. The `core-api` and `httpclient` packages are [optimizely-sdk-core-api](https://mvnrepository.com/artifact/com.optimizely.ab/core-api) and [optimizely-sdk-httpclient](https://mvnrepository.com/artifact/com.optimizely.ab/core-httpclient-impl), respectively.
### Install the SDK

The Java SDK is distributed through Maven Central and is created with source and target compatibility of Java 1.8. The `core-api` and `httpclient` packages are [optimizely-sdk-core-api](https://mvnrepository.com/artifact/com.optimizely.ab/core-api) and [optimizely-sdk-httpclient](https://mvnrepository.com/artifact/com.optimizely.ab/core-httpclient-impl), respectively.

---

**NOTE**

Optimizely previously distributed the Java SDK through Bintray/JCenter. But, as of April 27, 2021, [Bintray/JCenter will become a read-only repository indefinitely](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/). The publish repository has been migrated to [MavenCentral](https://mvnrepository.com/artifact/com.optimizely.ab) for the SDK version 3.8.1 or later.

---


```

repositories {

mavenCentral()

jcenter()

}



dependencies {

compile 'com.optimizely.ab:core-api:{VERSION}'

compile 'com.optimizely.ab:core-httpclient-impl:{VERSION}'

// The SDK integrates with multiple JSON parsers, here we use

// Jackson.

compile 'com.fasterxml.jackson.core:jackson-core:2.7.1'

compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.1'

compile 'com.fasterxml.jackson.core:jackson-databind:2.7.1'

Mat001 marked this conversation as resolved.
Show resolved Hide resolved
}
```

#### Dependencies
```

`core-api` requires [org.slf4j:slf4j-api:1.7.16](https://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.16) and a supported JSON parser.
We currently integrate with [Jackson](https://github.com/FasterXML/jackson), [GSON](https://github.com/google/gson), [json.org](http://www.json.org),
and [json-simple](https://code.google.com/archive/p/json-simple); if any of those packages are available at runtime, they will be used by `core-api`.
If none of those packages are already provided in your project's classpath, one will need to be added. `core-httpclient-impl` is an optional
dependency that implements the event dispatcher and requires [org.apache.httpcomponents:httpclient:4.5.2](https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5.2).
The supplied `pom` files on Bintray define module dependencies.
### Dependencies
Mat001 marked this conversation as resolved.
Show resolved Hide resolved

### Feature Management Access
To access the Feature Management configuration in the Optimizely dashboard, please contact your Optimizely account executive.
`core-api` requires [org.slf4j:slf4j-api:1.7.16](https://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.16) and a supported JSON parser.

### Using the SDK
We currently integrate with [Jackson](https://github.com/FasterXML/jackson), [GSON](https://github.com/google/gson), [json.org](http://www.json.org), and [json-simple](https://code.google.com/archive/p/json-simple); if any of those packages are available at runtime, they will be used by `core-api`. If none of those packages are already provided in your project's classpath, one will need to be added.

See the Optimizely Full Stack [developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0-full-stack/docs/java-sdk) to learn how to set
up your first Java project and use the SDK.
`core-httpclient-impl` is an optional dependency that implements the event dispatcher and requires [org.apache.httpcomponents:httpclient:4.5.2](https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5.2).

## Development
## Use the Java SDK

### Building the SDK
See the Optimizely Feature Experimentation [developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0-full-stack/docs/java-sdk) to learn how to set up your first Java project and use the SDK.

To build local jars which are outputted into the respective modules' `build/lib` directories:

```
./gradlew build
```
## SDK Development

### Unit tests

#### Running all tests

You can run all unit tests with:

```

./gradlew test

```

### Checking for bugs

We utilize [FindBugs](http://findbugs.sourceforge.net/) to identify possible bugs in the SDK. To run the check:

```

./gradlew check

```

### Benchmarking

[JMH](http://openjdk.java.net/projects/code-tools/jmh/) benchmarks can be run through gradle:

```

./gradlew core-api:jmh

```

Results are generated in `$buildDir/reports/jmh`.
Expand All @@ -112,34 +123,74 @@ This software incorporates code from the following open source projects:

#### core-api module

**SLF4J** [https://www.slf4j.org ](https://www.slf4j.org)
Copyright © 2004-2017 QOS.ch
**SLF4J** [https://www.slf4j.org ](https://www.slf4j.org)

Copyright © 2004-2017 QOS.ch

License (MIT): [https://www.slf4j.org/license.html](https://www.slf4j.org/license.html)

**Jackson Annotations** [https://github.com/FasterXML/jackson-annotations](https://github.com/FasterXML/jackson-annotations)
**Jackson Annotations** [https://github.com/FasterXML/jackson-annotations](https://github.com/FasterXML/jackson-annotations)

License (Apache 2.0): [https://github.com/FasterXML/jackson-annotations/blob/master/src/main/resources/META-INF/LICENSE](https://github.com/FasterXML/jackson-annotations/blob/master/src/main/resources/META-INF/LICENSE)

**Gson** [https://github.com/google/gson ](https://github.com/google/gson)
**Gson** [https://github.com/google/gson ](https://github.com/google/gson)

Copyright © 2008 Google Inc.

License (Apache 2.0): [https://github.com/google/gson/blob/master/LICENSE](https://github.com/google/gson/blob/master/LICENSE)

**JSON-java** [https://github.com/stleary/JSON-java](https://github.com/stleary/JSON-java)
Copyright © 2002 JSON.org
**JSON-java** [https://github.com/stleary/JSON-java](https://github.com/stleary/JSON-java)

Copyright © 2002 JSON.org

License (The JSON License): [https://github.com/stleary/JSON-java/blob/master/LICENSE](https://github.com/stleary/JSON-java/blob/master/LICENSE)

**JSON.simple** [https://code.google.com/archive/p/json-simple/](https://code.google.com/archive/p/json-simple/)
Copyright © January 2004
**JSON.simple** [https://code.google.com/archive/p/json-simple/](https://code.google.com/archive/p/json-simple/)

Copyright © January 2004

License (Apache 2.0): [https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt](https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)

**Jackson Databind** [https://github.com/FasterXML/jackson-databind](https://github.com/FasterXML/jackson-databind)
**Jackson Databind** [https://github.com/FasterXML/jackson-databind](https://github.com/FasterXML/jackson-databind)

License (Apache 2.0): [https://github.com/FasterXML/jackson-databind/blob/master/src/main/resources/META-INF/LICENSE](https://github.com/FasterXML/jackson-databind/blob/master/src/main/resources/META-INF/LICENSE)

#### core-httpclient-impl module

**Gson** [https://github.com/google/gson ](https://github.com/google/gson)
**Gson** [https://github.com/google/gson ](https://github.com/google/gson)

Copyright © 2008 Google Inc.

License (Apache 2.0): [https://github.com/google/gson/blob/master/LICENSE](https://github.com/google/gson/blob/master/LICENSE)

**Apache HttpClient** [https://hc.apache.org/httpcomponents-client-ga/index.html ](https://hc.apache.org/httpcomponents-client-ga/index.html)
**Apache HttpClient** [https://hc.apache.org/httpcomponents-client-ga/index.html ](https://hc.apache.org/httpcomponents-client-ga/index.html)

Copyright © January 2004

License (Apache 2.0): [https://github.com/apache/httpcomponents-client/blob/master/LICENSE.txt](https://github.com/apache/httpcomponents-client/blob/master/LICENSE.txt)

### Other Optimzely SDKs

- Agent - https://github.com/optimizely/agent

- Android - https://github.com/optimizely/android-sdk

- C# - https://github.com/optimizely/csharp-sdk

- Flutter - https://github.com/optimizely/optimizely-flutter-sdk

- Go - https://github.com/optimizely/go-sdk

- Java - https://github.com/optimizely/java-sdk

- JavaScript - https://github.com/optimizely/javascript-sdk

- PHP - https://github.com/optimizely/php-sdk

- Python - https://github.com/optimizely/python-sdk

- React - https://github.com/optimizely/react-sdk

- Ruby - https://github.com/optimizely/ruby-sdk

- Swift - https://github.com/optimizely/swift-sdk
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def customizePom(pom, title) {

name title
url 'https://github.com/optimizely/java-sdk'
description 'The Java SDK for Optimizely Full Stack (feature flag management for product development teams)'
description 'The Java SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts'
licenses {
license {
name 'The Apache Software License, Version 2.0'
Expand Down
6 changes: 3 additions & 3 deletions core-api/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Java SDK Core API
This package contains the core APIs and interfaces for the Optimizely Full Stack API in Java.
This package contains the core APIs and interfaces for the Optimizely Feature Experimentation API in Java.

Full product documentation is in the [Optimizely developers documentation](https://docs.developers.optimizely.com/full-stack/docs/welcome).
Full product documentation is in the [Optimizely developers documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/welcome).

## Installation

Expand All @@ -22,7 +22,7 @@ compile 'com.optimizely.ab:core-api:{VERSION}'

## Optimizely
[`Optimizely`](https://github.com/optimizely/java-sdk/blob/master/core-api/src/main/java/com/optimizely/ab/Optimizely.java)
provides top level API access to the Full Stack project.
provides top level API access to the Feature Experimentation project.

### Usage
```Java
Expand Down