Skip to content

Commit 439d4a8

Browse files
committed
Migrating library distribution to use Maven Cetral
1 parent 800779c commit 439d4a8

File tree

5 files changed

+38
-76
lines changed

5 files changed

+38
-76
lines changed

.github/workflows/master.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Master CI
1+
name: Master CI v1
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88

99
jobs:
1010
build-scan:
@@ -34,8 +34,8 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
java: [ '8', '11', '17', '18', '21']
38-
os: [ ubuntu-latest, windows-latest ]
37+
java: ['8', '11', '17', '21']
38+
os: [ubuntu-latest, windows-latest]
3939
runs-on: ${{ matrix.os }}
4040
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
4141

.github/workflows/release.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
name: Release CI
1+
name: Release CI v1
22

33
on:
44
release:
5-
types: [ created ]
5+
types: [created]
6+
branches: [master]
67

78
jobs:
89
build-test:
910
name: Build & Test - JDK ${{ matrix.java }} on ${{ matrix.os }}
1011
strategy:
1112
fail-fast: false
1213
matrix:
13-
java: [ '8', '11', '17', '18', '21']
14-
os: [ ubuntu-latest, windows-latest ]
14+
java: ['8', '11', '17', '21']
15+
os: [ubuntu-latest, windows-latest]
1516
runs-on: ${{ matrix.os }}
1617

1718
steps:
@@ -38,7 +39,7 @@ jobs:
3839

3940
publish:
4041
name: Publish Release
41-
needs: [ build-test ]
42+
needs: [build-test]
4243
runs-on: ubuntu-latest
4344

4445
steps:
@@ -48,15 +49,15 @@ jobs:
4849
with:
4950
distribution: 'temurin'
5051
java-version: '11'
51-
server-id: ossrh
52-
server-username: OSSRH_USERNAME
53-
server-password: OSSRH_TOKEN
52+
server-id: central
53+
server-username: CENTRAL_USERNAME
54+
server-password: CENTRAL_TOKEN
5455
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
5556
gpg-passphrase: MAVEN_GPG_PASSPHRASE
5657

5758
- name: Publish to Apache Maven Central
5859
run: mvn deploy -DskipTests -Psign
5960
env:
60-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
61-
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
61+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
62+
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
6263
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A Java SDK for Switcher API
88

99
<div align="center">
1010

11-
[![Master CI](https://github.com/switcherapi/switcher-client-java/actions/workflows/master.yml/badge.svg)](https://github.com/switcherapi/switcher-client-java/actions/workflows/master.yml)
11+
[![Master CI](https://github.com/switcherapi/switcher-client-java/actions/workflows/master.yml/badge.svg?branch=master)](https://github.com/switcherapi/switcher-client-java/actions/workflows/master.yml)
1212
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=switcherapi_switcher-client&metric=alert_status)](https://sonarcloud.io/dashboard?id=switcherapi_switcher-client)
1313
[![Known Vulnerabilities](https://snyk.io/test/github/switcherapi/switcher-client-java/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/switcherapi/switcher-client-java?targetFile=pom.xml)
1414
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

pom.xml

Lines changed: 20 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<groupId>com.github.switcherapi</groupId>
99
<artifactId>switcher-client</artifactId>
1010
<packaging>jar</packaging>
11-
<version>1.6.3</version>
11+
<version>1.6.4-SNAPSHOT</version>
1212

1313
<name>Switcher Client</name>
1414
<description>Switcher Client SDK for working with Switcher API</description>
@@ -63,19 +63,20 @@
6363
<slf4j-api.version>2.0.17</slf4j-api.version>
6464

6565
<!-- test -->
66-
<okhttp.version>5.0.0-alpha.14</okhttp.version>
67-
<junit.version>5.12.0</junit.version>
66+
<okhttp.version>5.0.0-alpha.16</okhttp.version>
67+
<junit-jupiter.version>5.13.0</junit-jupiter.version>
6868
<junit-pioneer.version>1.9.1</junit-pioneer.version>
69+
<junit-platform-launcher.version>1.13.0</junit-platform-launcher.version>
6970

7071
<!-- Plugins -->
7172
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
7273
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
7374
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
74-
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
7575
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
7676
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
7777
<sonar-maven-plugin.version>3.11.0.3922</sonar-maven-plugin.version>
7878
<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
79+
<central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
7980

8081
<!-- Sonar -->
8182
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
@@ -136,13 +137,19 @@
136137
<dependency>
137138
<groupId>org.junit.jupiter</groupId>
138139
<artifactId>junit-jupiter-engine</artifactId>
139-
<version>${junit.version}</version>
140+
<version>${junit-jupiter.version}</version>
140141
<scope>provided</scope>
141142
</dependency>
142143
<dependency>
143144
<groupId>org.junit.jupiter</groupId>
144145
<artifactId>junit-jupiter-params</artifactId>
145-
<version>${junit.version}</version>
146+
<version>${junit-jupiter.version}</version>
147+
<scope>test</scope>
148+
</dependency>
149+
<dependency>
150+
<groupId>org.junit.platform</groupId>
151+
<artifactId>junit-platform-launcher</artifactId>
152+
<version>${junit-platform-launcher.version}</version>
146153
<scope>test</scope>
147154
</dependency>
148155
<dependency>
@@ -171,52 +178,6 @@
171178
</dependency>
172179
</dependencies>
173180

174-
<dependencyManagement>
175-
<dependencies>
176-
<dependency>
177-
<groupId>junit</groupId>
178-
<artifactId>junit</artifactId>
179-
<version>4.13.2</version>
180-
</dependency>
181-
182-
<dependency>
183-
<groupId>org.junit.platform</groupId>
184-
<artifactId>junit-platform-launcher</artifactId>
185-
<version>1.12.0</version>
186-
<scope>test</scope>
187-
</dependency>
188-
189-
<dependency>
190-
<groupId>com.fasterxml.jackson.core</groupId>
191-
<artifactId>jackson-annotations</artifactId>
192-
<version>2.18.3</version>
193-
</dependency>
194-
195-
<dependency>
196-
<groupId>com.fasterxml.jackson.core</groupId>
197-
<artifactId>jackson-databind</artifactId>
198-
<version>2.18.3</version>
199-
</dependency>
200-
201-
<dependency>
202-
<groupId>com.fasterxml.jackson.module</groupId>
203-
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
204-
<version>2.18.3</version>
205-
</dependency>
206-
</dependencies>
207-
</dependencyManagement>
208-
209-
<distributionManagement>
210-
<snapshotRepository>
211-
<id>ossrh</id>
212-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
213-
</snapshotRepository>
214-
<repository>
215-
<id>ossrh</id>
216-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
217-
</repository>
218-
</distributionManagement>
219-
220181
<profiles>
221182
<profile>
222183
<id>coverage</id>
@@ -361,15 +322,15 @@
361322
<version>${maven-surefire-plugin.version}</version>
362323
</plugin>
363324

364-
<!-- Exclude log4j2 properties -->
325+
<!-- Publish to Maven Central -->
365326
<plugin>
366-
<groupId>org.apache.maven.plugins</groupId>
367-
<artifactId>maven-jar-plugin</artifactId>
368-
<version>${maven-jar-plugin.version}</version>
327+
<groupId>org.sonatype.central</groupId>
328+
<artifactId>central-publishing-maven-plugin</artifactId>
329+
<version>${central-publishing-maven-plugin.version}</version>
330+
<extensions>true</extensions>
369331
<configuration>
370-
<excludes>
371-
<exclude>**/log4j2.properties</exclude>
372-
</excludes>
332+
<publishingServerId>central</publishingServerId>
333+
<autoPublish>true</autoPublish>
373334
</configuration>
374335
</plugin>
375336
</plugins>

src/main/java/com/github/switcherapi/client/model/SwitcherRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public SwitcherResult submit() throws SwitcherException {
104104
}
105105
}
106106

107-
final SwitcherResult response = this.switcherExecutor.executeCriteria(this);
107+
final SwitcherResult response = this.executeCriteria();
108108
this.updateHistoryExecution(response);
109109
return response;
110110
}

0 commit comments

Comments
 (0)