Skip to content

Commit 2d588f9

Browse files
committed
Publish to maven central with groupId com.contentgrid.opa-java-client
1 parent 86eea00 commit 2d588f9

File tree

8 files changed

+54
-35
lines changed

8 files changed

+54
-35
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
env:
2222
SIGNING_PRIVATE_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}
2323
SIGNING_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
24-
ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
25-
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
24+
ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.SONATYPE_S01_USERNAME }}
25+
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.SONATYPE_S01_PASSWORD }}
2626
run: ./gradlew publish

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.4.0 - (Unreleased)
9+
10+
Changed:
11+
* [#7] - Moved maven group coordinates to `com.contentgrid.opa-java-client`
12+
13+
Housekeeping:
14+
* [#6] - Updated Gradle to 7.5.1
15+
* [#6] - Updated dependencies to Spring Boot 2.6.12 baseline
16+
17+
[#6]: https://github.com/xenit-eu/opa-java-client/pull/6
18+
[#7]: https://github.com/xenit-eu/opa-java-client/pull/7/files
819
## 0.3.0 - 2021-12-09
920

1021
Fixed:
11-
1222
* [#4] - OPA client can now serialize `java.time` classes as `input`
1323

1424
[#4]: https://github.com/xenit-eu/opa-java-client/pull/4

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# OpenPolicyAgent Java Client
22

3-
[![Build](https://github.com/content-cloud/opa-java-client/workflows/build/badge.svg?branch=main)](https://github.com/xenit-eu/opa-java-client/actions/workflows/ci.yml)
4-
[![Maven Central](https://img.shields.io/maven-central/v/eu.xenit.contentcloud/opa-async-java-client?color=blue)](https://search.maven.org/search?q=a:opa-async-java-client%20g:eu.xenit.contentcloud)
3+
[![Build](https://github.com/xenit-eu/opa-java-client/workflows/build/badge.svg?branch=main)](https://github.com/xenit-eu/opa-java-client/actions/workflows/ci.yml)
4+
[![Maven Central](https://img.shields.io/maven-central/v/com.contentgrid.opa-java-client/opa-async-java-client?color=blue)](https://search.maven.org/search?q=a:opa-async-java-client%20g:com.contentgrid.opa-java-client)
55
[![License](https://img.shields.io/github/license/xenit-eu/opa-java-client?color=blue)](LICENSE)
66

77
An asynchronous java client library for the [OpenPolicyAgent](https://www.openpolicyagent.org/) [REST API](https://www.openpolicyagent.org/docs/latest/rest-api/).
@@ -17,7 +17,7 @@ The design of the project is borrowed from [Bisnode/opa-java-client](https://git
1717
uses an async programming model instead, which makes it suitable to be used in a reactive application stack.
1818

1919
This client library uses the JDK11+ HttpClient by default, but allows you to plug in your own http-client by providing
20-
an implementation for the [OpaRestClient](https://github.com/xenit-eu/opa-async-java-client/blob/main/opa-async-java-client/src/main/java/eu/xenit/contentcloud/abac/opa/client/rest/OpaRestClient.java)
20+
an implementation for the [OpaRestClient](https://github.com/xenit-eu/opa-async-java-client/blob/main/opa-async-java-client/src/main/java/com/contentgrid/opa/client/rest/OpaHttpClient.java)
2121
interface.
2222

2323
## Installation
@@ -27,14 +27,14 @@ interface.
2727
Using Gradle:
2828

2929
```groovy
30-
implementation "eu.xenit.contentcloud:opa-async-java-client:${version}"
30+
implementation "com.contentgrid.opa-java-client:opa-async-java-client:${version}"
3131
```
3232

3333
Using Maven:
3434

3535
```xml
3636
<dependency>
37-
<groupId>eu.xenit.contentcloud</groupId>
37+
<groupId>com.contentgrid.opa-java-client</groupId>
3838
<artifactId>opa-async-java-client</artifactId>
3939
<version>${version}</version>
4040
</dependency>

build.gradle

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
plugins {
22
id "org.ajoberstar.reckon" version "0.13.0"
3+
id "io.github.gradle-nexus.publish-plugin" version '1.1.0'
34
}
45

56
reckon {
67
scopeFromProp()
78
snapshotFromProp()
89
}
910

10-
configure(subprojects) {
11-
plugins.withType(JavaPlugin) {
11+
allprojects {
12+
pluginManager.withPlugin('maven-publish') {
13+
apply from: "${rootDir}/gradle/publish.gradle"
14+
}
15+
pluginManager.withPlugin('java') {
1216
java {
17+
sourceCompatibility = JavaVersion.VERSION_11
1318
withSourcesJar()
1419
withJavadocJar()
1520
}
16-
1721
repositories {
1822
mavenCentral()
1923
}
2024
}
2125
}
2226

23-
reckonTagCreate.dependsOn project.getTasksByName("check", true)
27+
nexusPublishing {
28+
repositories {
29+
sonatype {
30+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
31+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
32+
33+
username = project.findProperty('sonatype_username')
34+
password = project.findProperty('sonatype_password')
35+
}
36+
}
37+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
group=eu.xenit.contentcloud
1+
group=com.contentgrid.opa-java-client
22

33
springBootVersion=2.6.12
44
lombokVersion=1.18.22

gradle/publish.gradle

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ apply plugin: 'signing'
33

44
publishing {
55
publications {
6-
library(MavenPublication) {
7-
from components.java
8-
}
9-
106
all {
117
pom {
128
url = 'https://github.com/xenit-eu/opa-java-client'
@@ -35,22 +31,23 @@ publishing {
3531
}
3632
}
3733
}
34+
}
3835

39-
40-
repositories {
41-
if (version.version.isSignificant()) {
42-
sonatypeMavenCentral {
43-
credentials {
44-
username = project.findProperty('sonatype_username')
45-
password = project.findProperty('sonatype_password')
46-
}
36+
pluginManager.withPlugin('java') {
37+
publishing {
38+
publications {
39+
library(MavenPublication) {
40+
from components.java
4741
}
48-
} else {
49-
sonatypeSnapshots {
50-
credentials {
51-
username = project.findProperty('sonatype_username')
52-
password = project.findProperty('sonatype_password')
53-
}
42+
}
43+
}
44+
}
45+
46+
pluginManager.withPlugin('java-platform') {
47+
publishing {
48+
publications {
49+
platform(MavenPublication) {
50+
from components.javaPlatform
5451
}
5552
}
5653
}

opa-async-java-client/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
plugins {
22
id 'java-library'
3+
id 'maven-publish'
34
}
45

5-
apply from: "${rootDir}/gradle/publish.gradle"
6-
76
dependencies {
87
api platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
98

rego-java/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
plugins {
22
id 'java-library'
3+
id 'maven-publish'
34
}
45

5-
apply from: "${rootDir}/gradle/publish.gradle"
6-
76
dependencies {
87
api platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
98

0 commit comments

Comments
 (0)