Skip to content

Commit c5e97a1

Browse files
committed
* Moved to maven dependencies
* Fixing Docker build
1 parent 3d29982 commit c5e97a1

38 files changed

+1957
-769
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you feel happy **Give me a STAR** to this **repository**.
1313
* OAuth2.0 Resource Server
1414
* We use [PostgreSQL](https://www.postgresql.org/)
1515
* We use [Liquibase](https://www.liquibase.org/)
16-
* We use [Gradle 4.10.2](https://gradle.org/install/)
16+
* We use [Maven](http://maven.apache.org/install.html)
1717
* We use [Docker](https://docs.docker.com/install/), to simplify understanding application flow.
1818
* We use [JWT](https://jwt.io/) Token RSA, production ready.
1919
* File upload API (Using Oauth2 Resource Server)
@@ -313,14 +313,14 @@ After **create database**, build the entire project.
313313

314314
```bash
315315
cd authorization_server
316-
gradle build
316+
maven package
317317
```
318318

319319
- **Resource Server**
320320

321321
```bash
322322
cd resource_server
323-
gradle build
323+
maven package
324324
```
325325

326326
**Generate RSA KeyStore**
@@ -365,7 +365,7 @@ paste to ```main/resources/certificate``` folder
365365

366366
MIT License
367367

368-
Copyright (c) 2018 odenktools
368+
Copyright (c) 2018 - 2020 odenktools
369369

370370
Permission is hereby granted, free of charge, to any person obtaining a copy
371371
of this software and associated documentation files (the "Software"), to deal

authorization_server/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.gradle
22
/build/
3+
/target/
34
!gradle/wrapper/gradle-wrapper.jar
45

56
### STS ###

authorization_server/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
1818

1919
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
2020

21-
ENV JAVA_VERSION 8u181
22-
23-
ENV JAVA_ALPINE_VERSION 8.181.13-r0
21+
ENV JAVA_VERSION 8u222
2422

2523
RUN set -x \
26-
&& apk add --update --no-cache \
27-
openjdk8="$JAVA_ALPINE_VERSION" bash tzdata && \
24+
&& apk add --update \
25+
openjdk8 bash tzdata && \
2826
rm -rf /var/cache/apk/* && \
2927
[ "$JAVA_HOME" = "$(docker-java-home)" ] && \
3028
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
@@ -34,9 +32,9 @@ ARG JAR_FILE
3432

3533
COPY ${JAR_FILE} /usr/local/bin/authserver.jar
3634

37-
COPY wait-for-it.sh /usr/bin
35+
COPY wait-for-it.sh /usr/local/bin/wait-for-it.sh
3836

39-
RUN chmod +x /usr/bin/wait-for-it.sh
37+
RUN chmod +x /usr/local/bin/wait-for-it.sh
4038

4139
EXPOSE 8090
4240

authorization_server/README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,46 @@ gradle bootRun
1212
Build Jar
1313

1414
```bash
15-
gradle build -x test
15+
mvn package
1616
```
1717

1818
Or Build Jar without test
1919

2020
```bash
21-
gradle build -x test
21+
mvn package -Dmaven.test.skip=true
2222
```
2323

2424
Execute Jar Package
2525

2626
```bash
27-
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8090,suspend=n -jar build/libs/authserver-0.1.0.jar
27+
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8090,suspend=n -jar target/authserver-1.0.0.jar
28+
```
29+
30+
OR
31+
32+
```bash
33+
mvn spring-boot:run
2834
```
2935

3036
#### Build docker container
3137

3238
```bash
33-
docker build --tag odenktools/oauth2-authorization-server:0.1.0 --build-arg JAR_FILE=build/libs/authserver-0.1.0.jar .
34-
docker push odenktools/oauth2-authorization-server:0.1.0
35-
docker tag odenktools/oauth2-authorization-server:0.1.0 odenktools/oauth2-authorization-server:latest
39+
docker build --tag odenktools/oauth2-authorization-server:1.0.0 --build-arg JAR_FILE=target/authserver-1.0.0.jar .
40+
docker tag odenktools/oauth2-authorization-server:1.0.0 odenktools/oauth2-authorization-server:latest
41+
```
42+
43+
#### Publish to Cloud
44+
45+
```bash
46+
docker push odenktools/oauth2-authorization-server:1.0.0
3647
docker push odenktools/oauth2-authorization-server:latest
3748
```
3849

3950
# LICENSE
4051

4152
MIT License
4253

43-
Copyright (c) 2018 odenktools
54+
Copyright (c) 2018 - 2020 odenktools
4455

4556
Permission is hereby granted, free of charge, to any person obtaining a copy
4657
of this software and associated documentation files (the "Software"), to deal

authorization_server/build.gradle

Lines changed: 0 additions & 83 deletions
This file was deleted.

authorization_server/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
4+
5+
docker build --tag odenktools/oauth2-authorization-server:1.0.0 --build-arg JAR_FILE=target/authserver-1.0.0.jar .
6+
7+
docker tag odenktools/oauth2-authorization-server:1.0.0 odenktools/oauth2-authorization-server:latest

authorization_server/checkstyle.xml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
3+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
4+
<module name="com.puppycrawl.tools.checkstyle.Checker">
5+
<!-- Root Checks -->
6+
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck">
7+
<property name="lineSeparator" value="lf"/>
8+
</module>
9+
10+
<module name="SuppressionFilter">
11+
<property name="file" value="${checkstyle.suppressions.file}" default="checkstyle-suppressions.xml"/>
12+
</module>
13+
14+
<!-- TreeWalker Checks -->
15+
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
16+
<!-- Annotations -->
17+
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck"/>
18+
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck"/>
19+
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck">
20+
<property name="allowSamelineSingleParameterlessAnnotation"
21+
value="false"/>
22+
</module>
23+
24+
<!-- Block Checks -->
25+
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck">
26+
<property name="option" value="text"/>
27+
</module>
28+
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"/>
29+
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck">
30+
<property name="option" value="alone"/>
31+
</module>
32+
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"/>
33+
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck"/>
34+
35+
<!-- Class Design -->
36+
<module name="com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck"/>
37+
<module name="com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck"/>
38+
<module name="com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck"/>
39+
<module name="com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck"/>
40+
<module name="com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck"/>
41+
42+
<!-- Coding -->
43+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck"/>
44+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck"/>
45+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck"/>
46+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck"/>
47+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
48+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck"/>
49+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck"/>
50+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck">
51+
<property name="max" value="3"/>
52+
</module>
53+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck">
54+
<property name="max" value="3"/>
55+
</module>
56+
57+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck">
58+
<property name="max" value="3"/>
59+
</module>
60+
61+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck"/>
62+
63+
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
64+
65+
<!-- Imports -->
66+
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
67+
68+
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck">
69+
<property name="excludes"
70+
value="io.restassured.RestAssured.*, org.apache.commons.lang3.RandomStringUtils.*, org.springframework.http.HttpStatus.*, java.lang.annotation.ElementType.*, java.lang.annotation.RetentionPolicy.*, org.assertj.core.api.Assertions.*, com.google.common.base.Preconditions.checkNotNull, org.hibernate.query.criteria.internal.ValueHandlerFactory.*, org.junit.Assert.*, org.junit.Assume.*, org.junit.internal.matchers.ThrowableMessageMatcher.*, org.hamcrest.CoreMatchers.*, org.hamcrest.Matchers.*, org.springframework.boot.configurationprocessor.ConfigurationMetadataMatchers.*, org.springframework.boot.configurationprocessor.TestCompiler.*, org.springframework.boot.test.autoconfigure.AutoConfigurationImportedCondition.*, org.mockito.Mockito.*, org.mockito.BDDMockito.*, org.mockito.ArgumentMatchers.*, org.mockito.Matchers.*, org.springframework.restdocs.hypermedia.HypermediaDocumentation.*, org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.*, org.springframework.restdocs.operation.preprocess.Preprocessors.*, org.springframework.restdocs.payload.PayloadDocumentation.*, org.springframework.restdocs.request.RequestDocumentation.*, org.springframework.restdocs.restassured3.operation.preprocess.RestAssuredPreprocessors.*, org.springframework.restdocs.restassured3.RestAssuredRestDocumentation.*, org.springframework.restdocs.webtestclient.WebTestClientRestDocumentation.*, org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*, org.springframework.test.web.servlet.result.MockMvcResultMatchers.*, org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*, org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.*, org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo, org.springframework.test.web.client.ExpectedCount.*, org.springframework.test.web.client.match.MockRestRequestMatchers.*, org.springframework.test.web.client.response.MockRestResponseCreators.*"/>
71+
</module>
72+
73+
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
74+
<property name="illegalPkgs"
75+
value="sun, org.apache.commons.(?!io|codec|compress|dbcp2|lang|lang3|logging|pool2).*, com.google.common.base.Preconditions.checkNotNull, org.flywaydb.core.internal, reactor.core.support.Assert"/>
76+
<property name="regexp" value="true"/>
77+
</module>
78+
79+
<module name="com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck"/>
80+
81+
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck">
82+
<property name="processJavadoc" value="true"/>
83+
</module>
84+
85+
<!-- Javadoc Comments -->
86+
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
87+
<property name="allowMissingJavadoc" value="true"/>
88+
</module>
89+
90+
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck">
91+
<property name="scope" value="public"/>
92+
</module>
93+
94+
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck">
95+
<property name="checkEmptyJavadoc" value="true"/>
96+
</module>
97+
98+
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/>
99+
100+
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck">
101+
<property name="offset" value="0"/>
102+
</module>
103+
104+
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck">
105+
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF"/>
106+
<property name="tagOrder" value="@param, @since, @see, @version, @serial, @deprecated"/>
107+
</module>
108+
109+
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck">
110+
<property name="target" value="METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
111+
<property name="tagOrder" value="@param, @return, @throws, @since, @deprecated, @see"/>
112+
</module>
113+
114+
<!-- Miscellaneous -->
115+
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck">
116+
<property name="tokens" value="BLOCK_COMMENT_BEGIN"/>
117+
</module>
118+
<module name="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck"/>
119+
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
120+
<module name="com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck"/>
121+
122+
<!-- Modifiers -->
123+
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck"/>
124+
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
125+
126+
<!-- Regexp -->
127+
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
128+
<property name="format" value="^(?!\s+\* $).*?\s+$"/>
129+
<property name="message"
130+
value="Line has leading space characters; indentation should be performed with tabs only."/>
131+
<property name="ignoreComments" value="true"/>
132+
</module>
133+
134+
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
135+
<property name="maximum" value="0"/>
136+
<property name="format" value="org\.mockito\.Mockito\.(when|doThrow|doAnswer)"/>
137+
<property name="message"
138+
value="Please use BDDMockito imports."/>
139+
<property name="ignoreComments" value="true"/>
140+
</module>
141+
142+
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck">
143+
<property name="format" value="[ \t]+$"/>
144+
<property name="illegalPattern" value="true"/>
145+
<property name="message" value="Trailing whitespace"/>
146+
</module>
147+
148+
<!-- Whitespace -->
149+
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck"/>
150+
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
151+
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
152+
<property name="tokens" value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS, ARRAY_DECLARATOR"/>
153+
</module>
154+
155+
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
156+
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
157+
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck"/>
158+
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
159+
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
160+
</module>
161+
</module>

authorization_server/gradle.properties

Lines changed: 0 additions & 18 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)