-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
104 lines (93 loc) · 2.9 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
plugins {
id 'java-library'
id 'signing'
id 'maven-publish'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}
group = 'io.github.daveschoutens.simple-jdbc'
version = '0.9.3'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'com.google.guava:guava:31.1-jre'
testImplementation 'com.google.truth:truth:1.1.3'
testImplementation 'com.zaxxer:HikariCP:4.0.3' // Cannot upgrade to 5.0.0 due to JDK version
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testImplementation 'org.mockito:mockito-core:4.3.1'
testImplementation 'org.testcontainers:junit-jupiter:1.16.3'
testImplementation 'org.testcontainers:postgresql:1.16.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testRuntimeOnly 'org.postgresql:postgresql:42.3.3'
}
compileJava {
sourceCompatibility = 1.8
}
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
}
signing {
// useGpgCmd()
sign publishing.publications.maven
}
project.plugins.withType(MavenPublishPlugin).all {
PublishingExtension publishing = project.extensions.getByType(PublishingExtension)
publishing.publications.withType(MavenPublication).all { mavenPublication ->
mavenPublication.pom {
name = "${project.group}:${project.name}"
description = name
url = 'https://github.com/daveschoutens/simple-jdbc'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'daveschoutens'
name = 'Dave Schoutens'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/daveschoutens/simple-jdbc'
developerConnection = 'scm:git:ssh://github.com/daveschoutens/simple-jdbc.git'
url = 'https://github.com/daveschoutens/simple-jdbc'
}
}
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri('https://s01.oss.sonatype.org/service/local/'))
snapshotRepositoryUrl.set(uri('https://s01.oss.sonatype.org/content/repositories/snapshots/'))
}
}
}
publishing {
repositories {
maven {
name = 'local'
def releasesRepoUrl = "$buildDir/repos/releases"
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}