Skip to content

Commit ed2ceca

Browse files
committed
Publish shadow jar
1 parent 5a8528c commit ed2ceca

13 files changed

+53
-46
lines changed

RELEASE_NOTES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Authentication Service MKII release notes
22

3+
## 0.7.1
4+
5+
* Publishes a shadow jar on jitpack.io for supporting tests in other repos.
6+
37
## 0.7.0
48

59
* BACKWARDS INCOMPATIBILITY - the auth server now logs to stdout vs. syslog.

build.gradle

+34-33
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,24 @@ plugins {
66
id 'java'
77
id 'war'
88
id 'jacoco'
9+
id 'maven-publish'
910
id 'org.ajoberstar.grgit' version '4.1.1'
1011
id 'com.github.johnrengelman.shadow' version '8.1.1'
1112
}
1213

14+
group = 'com.github.kbase'
15+
1316
repositories {
1417
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+
}
1527
}
1628
// Warning - these values are hard coded in AuthController.java
1729
def JAR_TEMPLATE_DIR = 'kbase_auth2_templates'
@@ -132,23 +144,17 @@ java -cp build/classes/java/main:\$CLASSPATH us.kbase.auth2.cli.AuthCLI \$@
132144
}
133145
}
134146

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"
143152
}
144153
}
145-
files(file.absolutePath)
146154
}
147155

148156
dependencies {
149157

150-
// ### General application dependencies ###
151-
152158
/* Notes on exclusions:
153159
* Bizarrely, the glassfish verison of inject has a dependency on v1 inject, which
154160
* causes problems when trying to build the fat jar
@@ -167,6 +173,20 @@ dependencies {
167173
implementation 'org.mongodb:mongodb-driver-sync:4.11.1'
168174
implementation 'org.mongodb:bson-record-codec:4.11.1'
169175
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"
170190
implementation 'com.github.spullara.mustache.java:compiler:0.9.3'
171191
implementation 'com.nulab-inc:zxcvbn:1.2.2'
172192
implementation 'nl.basjes.parse.useragent:yauaa:1.3'
@@ -192,28 +212,6 @@ dependencies {
192212
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
193213

194214

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-
217215
testImplementation 'commons-io:commons-io:2.4'
218216
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.10'
219217
testImplementation 'junit:junit:4.12'
@@ -229,6 +227,9 @@ dependencies {
229227
testImplementation 'de.danielbechler:java-object-diff:0.94'
230228
testImplementation 'org.jsoup:jsoup:1.10.2'
231229
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+
}
232233
}
233234

234235
task showTestClassPath {

src/main/java/us/kbase/auth2/Version.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
public class Version {
66

77
/** The version of the KBase Auth2 service. */
8-
public static final String VERSION = "0.7.0";
8+
public static final String VERSION = "0.7.1";
99

1010
}

src/test/java/us/kbase/test/auth2/MongoStorageTestManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import us.kbase.auth2.cryptutils.RandomDataGenerator;
2323
import us.kbase.auth2.lib.storage.mongo.MongoStorage;
24-
import us.kbase.common.test.controllers.mongo.MongoController;
24+
import us.kbase.testutils.controllers.mongo.MongoController;
2525

2626
public class MongoStorageTestManager {
2727

src/test/java/us/kbase/test/auth2/TestCommon.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import us.kbase.auth2.lib.TemporarySessionData;
4040
import us.kbase.auth2.lib.UserName;
4141
import us.kbase.auth2.lib.token.TemporaryToken;
42-
import us.kbase.common.test.TestException;
42+
import us.kbase.testutils.TestException;
4343

4444
public class TestCommon {
4545

src/test/java/us/kbase/test/auth2/authcontroller/AuthController.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package us.kbase.test.auth2.authcontroller;
22

3-
import static us.kbase.common.test.controllers.ControllerCommon.findFreePort;
4-
import static us.kbase.common.test.controllers.ControllerCommon.makeTempDirs;
3+
import static us.kbase.testutils.controllers.ControllerCommon.findFreePort;
4+
import static us.kbase.testutils.controllers.ControllerCommon.makeTempDirs;
55
import static us.kbase.test.auth2.TestConfigurator.MONGO_HOST_KEY;
66
import static us.kbase.test.auth2.TestConfigurator.MONGO_DB_KEY;
77
import static us.kbase.test.auth2.TestConfigurator.MONGO_TEMPLATES_KEY;
@@ -27,7 +27,7 @@
2727

2828
import com.fasterxml.jackson.databind.ObjectMapper;
2929

30-
import us.kbase.common.test.TestException;
30+
import us.kbase.testutils.TestException;
3131
import us.kbase.test.auth2.StandaloneAuthServer;
3232

3333
/** Q&D utility to run the auth server in test mode for use in testing rigs. Expected to

src/test/java/us/kbase/test/auth2/lib/storage/mongo/MongoStorageTester.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
import us.kbase.auth2.cryptutils.RandomDataGenerator;
1414
import us.kbase.auth2.lib.storage.mongo.MongoStorage;
15-
import us.kbase.common.test.controllers.mongo.MongoController;
1615
import us.kbase.test.auth2.MongoStorageTestManager;
16+
import us.kbase.testutils.controllers.mongo.MongoController;
1717

1818
public class MongoStorageTester {
1919

src/test/java/us/kbase/test/auth2/service/LoggingFilterTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
import us.kbase.auth2.service.AuthStartupConfig;
4343
import us.kbase.auth2.service.LoggingFilter;
4444
import us.kbase.auth2.service.SLF4JAutoLogger;
45-
import us.kbase.common.test.RegexMatcher;
4645
import us.kbase.test.auth2.MongoStorageTestManager;
4746
import us.kbase.test.auth2.StandaloneAuthServer;
4847
import us.kbase.test.auth2.TestCommon;
48+
import us.kbase.testutils.RegexMatcher;
4949
import us.kbase.test.auth2.StandaloneAuthServer.ServerThread;
5050

5151
public class LoggingFilterTest {

src/test/java/us/kbase/test/auth2/service/ServiceTestUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757
import us.kbase.auth2.lib.token.TokenName;
5858
import us.kbase.auth2.lib.token.TokenType;
5959
import us.kbase.auth2.service.AuthExternalConfig;
60-
import us.kbase.common.test.RegexMatcher;
6160
import us.kbase.test.auth2.MockIdentityProviderFactory;
6261
import us.kbase.test.auth2.MongoStorageTestManager;
6362
import us.kbase.test.auth2.TestCommon;
63+
import us.kbase.testutils.RegexMatcher;
6464

6565
public class ServiceTestUtils {
6666

src/test/java/us/kbase/test/auth2/service/common/ServiceCommonTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
public class ServiceCommonTest {
4848

4949
public static final String SERVICE_NAME = "Authentication Service";
50-
public static final String SERVER_VER = "0.7.0";
50+
public static final String SERVER_VER = "0.7.1";
5151
public static final String GIT_ERR =
5252
"Missing git commit file gitcommit, should be in us.kbase.auth2";
5353

src/test/java/us/kbase/test/auth2/service/ui/LoginTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@
7979
import us.kbase.auth2.lib.user.AuthUser;
8080
import us.kbase.auth2.lib.user.LocalUser;
8181
import us.kbase.auth2.lib.user.NewUser;
82-
import us.kbase.common.test.RegexMatcher;
8382
import us.kbase.test.auth2.MapBuilder;
8483
import us.kbase.test.auth2.MockIdentityProviderFactory;
8584
import us.kbase.test.auth2.MongoStorageTestManager;
8685
import us.kbase.test.auth2.StandaloneAuthServer;
8786
import us.kbase.test.auth2.TestCommon;
8887
import us.kbase.test.auth2.StandaloneAuthServer.ServerThread;
8988
import us.kbase.test.auth2.service.ServiceTestUtils;
89+
import us.kbase.testutils.RegexMatcher;
9090

9191
public class LoginTest {
9292

src/test/java/us/kbase/test/auth2/service/ui/PKCEChallengeMatcher.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import org.mockito.ArgumentMatcher;
66

7-
import us.kbase.common.test.RegexMatcher;
7+
import us.kbase.testutils.RegexMatcher;
8+
89

910
public class PKCEChallengeMatcher implements ArgumentMatcher<String> {
1011

src/test/java/us/kbase/test/auth2/service/ui/StateMatcher.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import org.mockito.ArgumentMatcher;
66

7-
import us.kbase.common.test.RegexMatcher;
7+
import us.kbase.testutils.RegexMatcher;
8+
89

910
public class StateMatcher implements ArgumentMatcher<String> {
1011

0 commit comments

Comments
 (0)