You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OpenFeature provider is published as a separate artifact. Applications that use only `com.featurevisor:featurevisor-java` receive no provider classes or OpenFeature dependency.
841
+
842
+
Add the provider with the same version as the Featurevisor Java SDK:
843
+
844
+
```xml
845
+
<dependency>
846
+
<groupId>com.featurevisor</groupId>
847
+
<artifactId>featurevisor-openfeature</artifactId>
848
+
<version>FEATUREVISOR_VERSION</version>
849
+
</dependency>
850
+
```
851
+
852
+
The provider artifact depends on the matching Featurevisor Java SDK and the compatible official OpenFeature SDK, so no additional dependency is required.
853
+
854
+
When upgrading from an earlier release, replace the direct `dev.openfeature:sdk` dependency with `com.featurevisor:featurevisor-openfeature`. The provider's Java package and public API are unchanged.
Use `checkout` for a flag, `checkout:variation` for its variation, and `checkout:title` for its `title` variable. Boolean variables use the boolean resolver. Lists, structures, and JSON variables use the object resolver.
874
+
875
+
OpenFeature's targeting key maps to `userId` by default. `targetingKeyField`, `keySeparator`, and `variationKey` on `FeaturevisorOpenFeatureProvider.Options` can customize the mapping.
876
+
877
+
You can also reuse an existing Featurevisor instance:
var provider =newFeaturevisorOpenFeatureProvider(featurevisor);
882
+
```
883
+
884
+
The caller owns an instance passed this way. Provider shutdown does not close it. Call `featurevisor.close()` when every consumer is finished with it. When the provider creates the instance from options, the provider owns and closes it. If both are configured, the existing instance takes precedence.
885
+
886
+
See the [OpenFeature provider guide](https://featurevisor.com/docs/sdks/openfeature/) for resolution reasons, errors, metadata, tracking, lifecycle, and providers for other languages.
887
+
837
888
<!-- FEATUREVISOR_DOCS_END -->
838
889
839
890
## Development of this package
@@ -852,11 +903,22 @@ $ mvn install
852
903
$ mvn test
853
904
```
854
905
906
+
The repository is a Maven reactor with two published libraries:
907
+
908
+
-`com.featurevisor:featurevisor-java`
909
+
-`com.featurevisor:featurevisor-openfeature`
910
+
911
+
To verify their published JAR and POM boundaries locally:
912
+
913
+
```bash
914
+
$ make verify-artifacts
915
+
```
916
+
855
917
### Releasing
856
918
857
919
- Manually create a new release on [GitHub](https://github.com/featurevisor/featurevisor-java/releases)
858
920
- Tag it with a prefix of `v`, like `v1.0.0`
859
-
- GitHub Actions is set up to automatically publish the package to [GitHub Packages](https://github.com/orgs/featurevisor/packages?repo_name=featurevisor-java)
921
+
- GitHub Actions publishes the parent POM, Java SDK, and OpenFeature provider to [GitHub Packages](https://github.com/orgs/featurevisor/packages?repo_name=featurevisor-java)
0 commit comments