forked from xvik/dropwizard-guicey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
163 lines (140 loc) · 4.6 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
plugins {
id 'groovy'
id 'jacoco'
id 'project-report'
id 'signing'
id 'ru.vyarus.java-lib' version '2.3.0'
id 'ru.vyarus.github-info' version '1.3.0'
id 'ru.vyarus.quality' version '4.7.0'
id 'net.researchgate.release' version '3.0.0'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'ru.vyarus.mkdocs' version '2.4.0'
}
sourceCompatibility = 1.8
wrapper {
gradleVersion = '7.4'
}
ext {
dropwizard = '2.1.0'
guice = '5.1.0'
hk2 = '2.6.1'
}
repositories { mavenLocal(); mavenCentral() }
dependencyManagement {
imports {
mavenBom "com.google.inject:guice-bom:$guice"
mavenBom "io.dropwizard:dropwizard-dependencies:$dropwizard"
}
// exclusions here mostly fixes conflicts for maven projects
dependencies {
// force guava version from dropwizard bom
dependency "com.google.guava:guava:${dependencyManagement.importedProperties['guava.version']}"
dependency "org.glassfish.hk2:guice-bridge:$hk2", {
exclude 'com.google.inject:guice'
exclude 'org.glassfish.hk2:hk2-api'
}
// SPOCK excluded from bom because it would complicate older version usage in gradle
dependency 'ru.vyarus:spock-junit5:1.0.0'
dependency "com.google.inject:guice:$guice", { exclude 'com.google.guava:guava' }
// add guicey itself to BOM (for version management)
dependency 'ru.vyarus:dropwizard-guicey:${project.version}'
}
}
dependencies {
provided 'org.junit.jupiter:junit-jupiter-api'
provided 'io.dropwizard:dropwizard-testing'
provided 'com.github.spotbugs:spotbugs-annotations:4.7.1'
provided "org.glassfish.hk2:guice-bridge"
implementation 'com.google.inject:guice'
implementation 'com.google.inject.extensions:guice-servlet'
implementation 'io.dropwizard:dropwizard-core'
implementation 'ru.vyarus:generics-resolver:3.0.3'
testImplementation 'ru.vyarus:spock-junit5'
testImplementation 'org.spockframework:spock-core:2.2-M1-groovy-4.0'
testImplementation 'org.glassfish.jersey.inject:jersey-hk2'
testImplementation 'io.dropwizard:dropwizard-auth'
testImplementation 'org.glassfish.jersey.ext:jersey-proxy-client'
testImplementation 'org.junit.platform:junit-platform-testkit'
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.1'
testImplementation "com.google.truth:truth:1.1.3"
// required for pure junit 5 tests
testRuntimeOnly 'org.junit.jupiter:junit-jupiter'
}
group = 'ru.vyarus'
description = 'Dropwizard guice integration'
github {
user = 'xvik'
license = 'MIT'
}
mkdocs {
publish {
docPath = '5.6.0'
rootRedirect = true
rootRedirectTo = 'latest'
versionAliases = ['latest']
}
extras = [
'version': '5.6.0',
'ext': '5.6.0-1',
'dropwizard': project.dropwizard,
'guice': project.guice
]
}
pom {
delegate.properties {
'guice.version' guice
'dropwizard.version' dropwizard
'hk2.version' hk2
}
developers {
developer {
id 'xvik'
name 'Vyacheslav Rusakov'
email '[email protected]'
}
}
}
javaLib {
// java 9 auto module name
autoModuleName = 'ru.vyarus.dropwizard.guicey'
// don't publish gradle metadata artifact
withoutGradleMetadata()
// put resolved dependencies versions
pom.forceVersions()
}
nexusPublishing {
repositories {
sonatype {
username = findProperty('sonatypeUser')
password = findProperty('sonatypePassword')
}
}
}
// skip signing for jitpack (snapshots)
tasks.withType(Sign) {onlyIf { !System.getenv('JITPACK') }}
// Required signing properties for release: signing.keyId, signing.password and signing.secretKeyRingFile
// (https://docs.gradle.org/current/userguide/signing_plugin.html#sec:signatory_credentials)
release.git.requireBranch.set('master')
afterReleaseBuild {
dependsOn = ['publishToSonatype',
'closeAndReleaseSonatypeStagingRepository']
doLast {
logger.warn "RELEASED $project.group:$project.name:$project.version"
}
}
test {
useJUnitPlatform()
testLogging {
events 'skipped', 'failed'
exceptionFormat 'full'
}
maxHeapSize = '512m'
}
dependencyUpdates.revision = 'release'
task updateGithubPom(type: Copy, group: 'other') {
from(generatePomFileForMavenPublication)
into '.github'
rename 'pom-default.xml', 'pom.xml'
}