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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: 'zulu'
java-version: 21

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: 'zulu'
java-version: 21
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

Expand Down
94 changes: 49 additions & 45 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'java'
apply plugin: 'java-library-distribution'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.github.ben-manes.versions'
Expand All @@ -20,27 +20,30 @@ buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
classpath "com.github.johnrengelman:shadow:8.1.1"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

distributions {
main {
baseName = 'omise-java'
archivesBaseName = 'omise-java'
}
}

Expand All @@ -57,48 +60,49 @@ artifacts {
archives javadocJar, sourcesJar
}

// REF: http://central.sonatype.org/pages/gradle.html
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

def ossrhUsername = System.getenv("SONATYPE_USERNAME")
def ossrhPassword = System.getenv("SONATYPE_PASSWORD")

repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'Omise Java'
description 'Java bindings for the Omise API'
packaging 'jar'
artifactId 'omise-java'
url 'https://www.omise.co'

scm {
connection 'scm:git:git://git.github.com/omise/omise-java'
developerConnection 'scm:git:git://git.github.com/omise/omise-java'
url 'https://github.com/omise/omise-java'
}
// REF: https://docs.gradle.org/current/userguide/publishing_maven.html
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'omise-java'

pom {
name = 'Omise Java'
description = 'Java bindings for the Omise API'
packaging = 'jar'
url = 'https://www.omise.co'

scm {
connection = 'scm:git:git://git.github.com/omise/omise-java'
developerConnection = 'scm:git:git://git.github.com/omise/omise-java'
url = 'https://github.com/omise/omise-java'
}

licenses {
license {
name 'The MIT License (MIT)'
url 'https://opensource.org/licenses/MIT'
licenses {
license {
name = 'The MIT License (MIT)'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'chakrit'
name = 'Omise'
email = 'support@omise.co'
}
}
}
}
}

developers {
developer {
id 'chakrit'
name 'Omise'
email 'support@omise.co'
}
repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
Expand Down Expand Up @@ -133,8 +137,8 @@ dependencies {
implementation 'joda-time:joda-time:2.9.9'

// persistence
compile 'com.fasterxml.jackson.core:jackson-core:2.9.10'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.10'
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.10'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.10'

// networking
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists