Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 10 additions & 6 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ jobs:
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
server-id: central
server-username: MAVEN_CENTRAL_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
- name: Publish to Maven Central
run: mvn clean deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
54 changes: 7 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,21 @@ This provider will work with Java 11 and above.

### Installation

The Octopus OpenFeature provider for Java is currently published to [GitHub Packages](https://github.com/OctopusDeploy/openfeature-provider-java/packages/2528379). It will be published to the Maven Central repository soon.

To add Maven package dependencies from GitHub Packages, you will need to add a Maven repository (in either your `settings.xml` or `pom.xml`), and create a GitHub Personal Access Token (classic) with `read:packages` scope, and configure this to be used to authenticate. An example `settings.xml` is shown below:

```xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/OctopusDeploy/openfeature-provider-java</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>USERNAME</username>
<password>TOKEN</password>
</server>
</servers>
</settings>
```
Read the GitHub docs for more information on [working with GitHub Packages as a Maven registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-to-github-packages).

Once this is configured, you can add the Octopus OpenFeature provider as a dependency. The Maven example is shown below.

The Octopus OpenFeature provider for Java is available as a [Maven package](https://central.sonatype.com/artifact/com.octopus.openfeature/octopus-openfeature-provider). You can add it to your project using your dependency manager (e.g. Maven or Gradle).

```xml
<dependency>
<groupId>com.octopus.openfeature</groupId>
<artifactId>octopus-openfeature-provider</artifactId>
<version>0.1.0</version> <!-- use current version number -->
<version>0.2.0</version> <!-- use current version number -->
</dependency>
```

```groovy
implementation group: 'com.octopus.openfeature', name: 'octopus-openfeature-provider', version: '0.2.0'
Comment on lines +25 to +30
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

The dependency version in the README (0.2.0) is inconsistent with the version in pom.xml (0.3.0-SNAPSHOT). Update the README to match the correct release version intended for Maven Central publishing.

Suggested change
<version>0.2.0</version> <!-- use current version number -->
</dependency>
```
```groovy
implementation group: 'com.octopus.openfeature', name: 'octopus-openfeature-provider', version: '0.2.0'
<version>0.3.0-SNAPSHOT</version> <!-- use current version number -->
</dependency>
implementation group: 'com.octopus.openfeature', name: 'octopus-openfeature-provider', version: '0.3.0-SNAPSHOT'

Copilot uses AI. Check for mistakes.
// Use current version number
```

### Usage

```java
Expand Down
81 changes: 79 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,103 @@

<groupId>com.octopus.openfeature</groupId>
<artifactId>octopus-openfeature-provider</artifactId>
<version>0.2.0</version>
<version>0.3.0-SNAPSHOT</version>
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

The version in pom.xml (0.3.0-SNAPSHOT) does not match the version referenced in README.md (0.2.0). Ensure consistency between the published artifact version and the documentation.

Copilot uses AI. Check for mistakes.
<packaging>jar</packaging>

<name>Octopus Deploy OpenFeature Provider</name>
<description>The Octopus Deploy provider for OpenFeature</description>
<url>https://octopus.com/docs/feature-toggles</url>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
</license>
</licenses>

<developers>
<developer>
<name>Michael Richardson</name>
<email>[email protected]</email>
<organization>Octopus Deploy</organization>
<organizationUrl>https://octopus.com</organizationUrl>
</developer>
</developers>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


<scm>
<url>https://github.com/OctopusDeploy/openfeature-provider-java</url>
</scm>

<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<!--
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/OctopusDeploy/openfeature-provider-java</url>
</repository>
</distributionManagement>
-->

<dependencies>
<dependency>
Expand Down