Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ com_crashlytics_export_strings.xml

*~
.gradle
/build
# /build
/out
/intTestHomeDir
/subprojects/*/out
Expand Down Expand Up @@ -78,5 +78,13 @@ com_crashlytics_export_strings.xml
.idea
*.sublime-*
.nb-gradle

TODO.txt
gradle/wrapper/*.jar
.gradle
TODO.txt
.gradle_cache
.gradle_cache/*
.gradle*
deploy
deploy/*
gradle_cache
gradle.properties
14 changes: 0 additions & 14 deletions DEPLOY.md

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This document refers to the **Java SDK** used for our API.

## Requirements

* Java 8
* Java 21

## Installation

Expand All @@ -20,7 +20,7 @@ To get started add our SDK as a dependency in your **pom.xml**:
<dependency>
<groupId>com.konduto.sdk</groupId>
<artifactId>java-sdk</artifactId>
<version>2.17.4</version>
<version>3.0.0</version>
</dependency>
```

Expand Down Expand Up @@ -90,7 +90,7 @@ This document refers to the **Java SDK** used for our API.

## Requirements

* Java 8
* Java 21

## Installation

Expand All @@ -100,7 +100,7 @@ To get started add our SDK as a dependency in your **pom.xml**:
<dependency>
<groupId>com.konduto.sdk</groupId>
<artifactId>java-sdk</artifactId>
<version>2.17.4</version>
<version>3.0.0</version>
</dependency>
```

Expand Down
133 changes: 57 additions & 76 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
plugins {
id 'java-library'
id 'java'
id 'maven-publish'
id 'signing'
id "com.vanniktech.maven.publish" version "0.28.0"
}

// Configuração da Toolchain Java (forma moderna e recomendada)
java {
toolchain {
// Define a versão de linguagem Java 17,11,8
languageVersion = JavaLanguageVersion.of(21)
}
// Cria automaticamente a tarefa javadocJar
// withJavadocJar()
}

def props = new Properties()
file("src/main/resources/konduto.properties").withInputStream { props.load(it) }

group = 'com.konduto.sdk'
version = props["version"]
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

// Configuração dos sourceSets
sourceSets {
main {
java {
Expand All @@ -37,96 +44,70 @@ repositories {
}

dependencies {
implementation('commons-httpclient:commons-httpclient:3.1') {
exclude group: 'commons-codec', module: 'commons-codec'
exclude group: 'junit', module: 'junit'
}
implementation('commons-codec:commons-codec:1.15') {
exclude group: 'junit', module: 'junit'
}
// Dependência de produção
implementation 'com.google.code.gson:gson:2.9.0'
// Dependências de teste
testImplementation 'junit:junit:4.13.2'
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.33.2'
testImplementation 'com.github.tomakehurst:wiremock-jre8:3.0.1'
}

// Configuração do compilador Java para mostrar avisos de depreciação
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}

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

task javadocJar(type: Jar) {
from javadoc
classifier "javadoc"
dependsOn javadoc
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}

// Configuração do JAR principal
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from configurations.compileClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'java-sdk'
from components.java
artifact sourcesJar
artifact javadocJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Konduto\'s Java SDK'
description = 'Easily integrate with Konduto (https://konduto' +
mavenPublishing {
coordinates(group, "java-sdk", version)

pom {
name = 'Konduto\'s Java SDK'
description = 'Easily integrate with Konduto (https://konduto' +
'.com), a fraud prevention service.'
url = 'https://konduto.com'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'danilo.carmo'
name = 'Danilo Carmo'
email = 'danilo.carmo@boavistascpc.com.br'
}
}
scm {
connection = 'https://github.com/konduto/java-sdk'
developerConnection = 'https://github.com/konduto/java-sdk'
url = 'https://github.com/konduto/java-sdk'
}
inceptionYear = "2025"
url = 'https://konduto.com'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
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 = props.getProperty('ossrhUsername')
password = props.getProperty('ossrhPassword')
developers {
developer {
id = 'danilo.carmo'
name = 'Danilo Carmo'
email = 'danilo.carmo@boavistascpc.com.br'
}
}
}
}
scm {
connection = 'https://github.com/konduto/java-sdk'
developerConnection = 'https://github.com/konduto/java-sdk'
url = 'https://github.com/konduto/java-sdk'
}
// properties {
// // Get toolchain version
// 'java.build.version' = project.javaBuildVersion
// }

javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}

signing {
sign publishing.publications.mavenJava
}
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)

// Enable GPG (obrigatorio)
signAllPublications()
}
Loading