forked from lsd-consulting/lsd-distributed-interceptors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
141 lines (126 loc) · 4.84 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import org.springframework.boot.gradle.plugin.SpringBootPlugin
plugins {
id 'java-library'
id 'org.springframework.boot' version '2.7.12' apply false
id 'io.spring.dependency-management' version '1.1.6'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'com.palantir.git-version' version '3.1.0'
id 'jacoco'
id 'org.jetbrains.kotlin.jvm' version '2.0.21'
id 'org.jetbrains.dokka' version "1.9.20"
}
group = 'io.github.lsd-consulting'
version = gitVersion().replaceAll("^v", "")
println "Build Version = ${version}"
kotlin {
jvmToolchain(17)
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
}
}
subprojects {
group = rootProject.getGroup()
version = rootProject.getVersion()
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:2021.0.6'
mavenBom 'io.pivotal.spring.cloud:spring-cloud-services-dependencies:4.1.6'
mavenBom SpringBootPlugin.BOM_COORDINATES
}
}
plugins.withId('maven-publish') {
bootJar {
enabled = false
}
jar {
enabled = true
archiveClassifier.set("")
}
tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier.set("sources")
from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
dependsOn(dokkaJavadoc)
archiveClassifier.set("javadoc")
from dokkaHtml.outputDirectory
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = "$group"
artifactId = "${rootProject.name}-${project.name}"
version = "$version"
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = "${rootProject.name}-${project.name}"
description = "A set of ${project.name} interceptors gathering information from distributed sources for the LSD library."
url = 'https://github.com/lsd-consulting/lsd-distributed-interceptors'
licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}
developers {
developer {
name = "Lukasz"
email = "[email protected]"
organization = 'Integreety Ltd.'
organizationUrl = 'https://www.integreety.co.uk'
}
developer {
name = "Nick"
email = "[email protected]"
organization = 'NKM IT Solutions'
organizationUrl = 'https://github.com/nickmcdowall'
}
}
scm {
url = "https://github.com/lsd-consulting/lsd-distributed-interceptors.git"
}
}
repositories {
maven {
name = 'sonatype'
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials(PasswordCredentials)
}
}
}
}
}
}
plugins.withId('signing') {
signing {
if (project.findProperty("signingKey")) {
// Use in-memory ascii-armored keys
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey as String, signingPassword as String)
sign publishing.publications.mavenJava
} else {
// Use signing properties in ~/.gradle/gradle.properties
sign publishing.publications.mavenJava
}
}
}
}
apply from: 'hooks.gradle'
nexusPublishing {
repositories {
sonatype { //only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}