Skip to content

Commit 1d7112e

Browse files
committed
Publish to maven central
1 parent 04edeb2 commit 1d7112e

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

.github/workflows/publish-maven.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
with:
2222
arguments: publish
2323
env:
24-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
25-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
24+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
25+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

build.gradle

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'eclipse'
33
apply plugin: 'java'
44
apply plugin: 'com.diffplug.spotless'
55

6-
group = 'co.unit.sdk'
6+
group = 'co.unit'
77
version = '0.2.3'
88

99
buildscript {
@@ -86,12 +86,15 @@ if(hasProperty('target') && target == 'android') {
8686
sourceCompatibility = JavaVersion.VERSION_11
8787
targetCompatibility = JavaVersion.VERSION_11
8888

89+
java {
90+
withSourcesJar()
91+
withJavadocJar()
92+
}
93+
8994
publishing {
9095
publications {
9196
maven(MavenPublication) {
92-
groupId = 'co.unit'
9397
artifactId = 'java-sdk'
94-
version = '0.2.3'
9598
from components.java
9699

97100
pom {
@@ -103,16 +106,17 @@ if(hasProperty('target') && target == 'android') {
103106

104107
repositories {
105108
maven {
106-
name = "OSSRH"
107-
url = "https://s01.oss.sonatype.org/content/repositories/releases/"
109+
name = "MavenCentral"
110+
url = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
108111
credentials {
109-
username = System.getenv("MAVEN_USERNAME")
110-
password = System.getenv("MAVEN_PASSWORD")
112+
username = System.getenv("MAVEN_CENTRAL_USERNAME")
113+
password = System.getenv("MAVEN_CENTRAL_PASSWORD")
111114
}
112115
}
113116
}
114117
}
115118

119+
116120
task execute(type:JavaExec) {
117121
main = System.getProperty('mainClass')
118122
classpath = sourceSets.main.runtimeClasspath
@@ -134,7 +138,6 @@ dependencies {
134138
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
135139
implementation "org.openapitools:jackson-databind-nullable:0.2.2"
136140
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
137-
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
138141
implementation "org.apache.httpcomponents:httpmime:$httpmime_version"
139142
implementation "commons-io:commons-io:2.5"
140143
testImplementation "junit:junit:$junit_version"

0 commit comments

Comments
 (0)