@@ -6,12 +6,24 @@ plugins {
6
6
id ' java'
7
7
id ' war'
8
8
id ' jacoco'
9
+ id ' maven-publish'
9
10
id ' org.ajoberstar.grgit' version ' 4.1.1'
10
11
id ' com.github.johnrengelman.shadow' version ' 8.1.1'
11
12
}
12
13
14
+ group = ' com.github.kbase'
15
+
13
16
repositories {
14
17
mavenCentral()
18
+
19
+ maven {
20
+ name = " Clojars"
21
+ url = " https://repo.clojars.org/"
22
+ }
23
+ maven {
24
+ name = " JitPack"
25
+ url = ' https://jitpack.io'
26
+ }
15
27
}
16
28
// Warning - these values are hard coded in AuthController.java
17
29
def JAR_TEMPLATE_DIR = ' kbase_auth2_templates'
@@ -132,23 +144,17 @@ java -cp build/classes/java/main:\$CLASSPATH us.kbase.auth2.cli.AuthCLI \$@
132
144
}
133
145
}
134
146
135
- def fromURL = { url , name ->
136
- File file = new File (" $buildDir /download/${ name} .jar" )
137
- file. parentFile. mkdirs()
138
- if (! file. exists()) {
139
- new URL (url). withInputStream { downloadStream ->
140
- file. withOutputStream { fileOut ->
141
- fileOut << downloadStream
142
- }
147
+ publishing {
148
+ publications {
149
+ shadow(MavenPublication ) { publication ->
150
+ project. shadow. component(publication)
151
+ artifactId = " auth2-test-shadow-all"
143
152
}
144
153
}
145
- files(file. absolutePath)
146
154
}
147
155
148
156
dependencies {
149
157
150
- // ### General application dependencies ###
151
-
152
158
/* Notes on exclusions:
153
159
* Bizarrely, the glassfish verison of inject has a dependency on v1 inject, which
154
160
* causes problems when trying to build the fat jar
@@ -167,6 +173,20 @@ dependencies {
167
173
implementation ' org.mongodb:mongodb-driver-sync:4.11.1'
168
174
implementation ' org.mongodb:bson-record-codec:4.11.1'
169
175
implementation ' org.mongodb:bson:4.11.1'
176
+ implementation(' com.github.kbase:java_common:0.3.0' ) {
177
+ exclude group : ' net.java.dev.jna' // breaks shadow jar
178
+ exclude group : ' org.eclipse.jetty.aggregate' // ugh, java common pollutes everything
179
+ exclude group : ' com.fasterxml.jackson.core' // breaks everything if we upgrade
180
+ exclude group : ' javax.servlet' , module : ' servlet-api' // 2.5 vs 3.1 below
181
+ // I have no idea why, but including the auth client in the build causes the shadow
182
+ // jar to fail to start correctly. It shouldn't be a problem, but it is
183
+ exclude group : ' com.github.kbase' , module : ' auth2_client_java'
184
+ }
185
+ implementation ' ch.qos.logback:logback-classic:1.1.2'
186
+ implementation ' org.slf4j:slf4j-api:1.7.25'
187
+ // TODO DEPS Need to rework the java common logger to not use syslog4j at all since it's
188
+ // abandonware and has a ton of CVEs, even in the newer versions.
189
+ implementation " org.syslog4j:syslog4j:0.9.46"
170
190
implementation ' com.github.spullara.mustache.java:compiler:0.9.3'
171
191
implementation ' com.nulab-inc:zxcvbn:1.2.2'
172
192
implementation ' nl.basjes.parse.useragent:yauaa:1.3'
@@ -192,28 +212,6 @@ dependencies {
192
212
implementation ' javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
193
213
194
214
195
- // ### Logging dependencies ###
196
- implementation fromURL(
197
- ' https://github.com/kbase/jars/raw/master/lib/jars/kbase/common/kbase-common-0.2.0.jar' ,
198
- ' kbase-common-0.2.0'
199
- )
200
- implementation ' ch.qos.logback:logback-classic:1.1.2'
201
- implementation ' org.slf4j:slf4j-api:1.7.25'
202
- // Syslog4j 0.9.46 doesn't appear to be available on Maven. It apparently lives in
203
- // a JetBrains artifact server, but that's too much trouble and there's only one version there
204
- // anyway.
205
- // https://mvnrepository.com/artifact/org.jetbrains/syslog4j/0.9.46
206
- // Need to rework the java common logger to not use syslog4j at all since it's abandonware
207
- // and has a ton of CVEs, even in the newer versions.
208
- implementation fromURL(
209
- ' https://github.com/kbase/jars/raw/master/lib/jars/syslog4j/syslog4j-0.9.46.jar' ,
210
- ' syslog4j-0.9.46'
211
- )
212
- // needed for syslog4j
213
- implementation ' joda-time:joda-time:2.3'
214
-
215
- // ### Test ###
216
-
217
215
testImplementation ' commons-io:commons-io:2.4'
218
216
testImplementation ' nl.jqno.equalsverifier:equalsverifier:3.1.10'
219
217
testImplementation ' junit:junit:4.12'
@@ -229,6 +227,9 @@ dependencies {
229
227
testImplementation ' de.danielbechler:java-object-diff:0.94'
230
228
testImplementation ' org.jsoup:jsoup:1.10.2'
231
229
testImplementation ' org.mockito:mockito-core:3.0.0'
230
+ testImplementation(' com.github.kbase:java_test_utilities:0.1.0' ) {
231
+ exclude group : ' com.fasterxml.jackson.core' // upgrading breaks stuff
232
+ }
232
233
}
233
234
234
235
task showTestClassPath {
0 commit comments