Skip to content

Commit 3d793e1

Browse files
committed
Update Spring, Gradle configuration, remove security, use OpenJ8 11 in Dockerfile
1 parent aabd096 commit 3d793e1

File tree

5 files changed

+37
-62
lines changed

5 files changed

+37
-62
lines changed

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:8-jdk-alpine as builder
1+
FROM adoptopenjdk/openjdk11-openj9:alpine as builder
22

33
EXPOSE 8080
44

@@ -8,13 +8,11 @@ ADD build.gradle /memes-api
88
ADD gradlew /memes-api
99
ADD gradlew.bat /memes-api
1010
ADD settings.gradle /memes-api
11-
ADD README.md /memes-api
12-
ADD LICENSE /memes-api
1311
ADD src /memes-api/src
1412
ADD gradle /memes-api/gradle
1513

1614
RUN ./gradlew assemble
1715

18-
FROM openjdk:8-jdk-alpine
16+
FROM adoptopenjdk/openjdk11-openj9:alpine
1917
COPY --from=builder /memes-api/build/libs/memes-api.jar memes-api.jar
2018
CMD ["java", "-jar", "memes-api.jar"]

build.gradle

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
buildscript {
2-
ext {
3-
springBootVersion = '2.1.2.RELEASE'
4-
}
5-
repositories {
6-
mavenCentral()
7-
}
8-
dependencies {
9-
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
10-
}
1+
plugins {
2+
id 'org.springframework.boot' version '2.2.0.M1'
3+
id 'java'
114
}
125

13-
apply plugin: 'java'
14-
apply plugin: 'org.springframework.boot'
156
apply plugin: 'io.spring.dependency-management'
167
apply plugin: 'jacoco'
178

9+
group = 'com.poprosturonin'
10+
version = ''
11+
sourceCompatibility = '11'
12+
13+
repositories {
14+
mavenCentral()
15+
maven { url 'https://repo.spring.io/snapshot' }
16+
maven { url 'https://repo.spring.io/milestone' }
17+
}
18+
1819
jar {
1920
version = ''
2021
}
@@ -28,24 +29,19 @@ jacocoTestReport {
2829

2930
check.dependsOn jacocoTestReport
3031

31-
group 'com.poprosturonin'
32-
version ''
33-
sourceCompatibility = '11'
34-
35-
repositories {
36-
mavenCentral()
37-
}
38-
3932
dependencies {
33+
implementation("org.springframework.boot:spring-boot-starter-web") {
34+
exclude group: "org.springframework.boot", module: "spring-boot-starter-tomcat"
35+
}
36+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
4037
compile 'org.jsoup:jsoup:1.10.1'
38+
compile group: 'org.json', name: 'json', version: '20140107'
4139
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'
42-
compile group: 'org.json', name: 'json', version: '20140107'
4340
implementation 'org.springframework.boot:spring-boot-starter-actuator'
44-
implementation 'org.springframework.boot:spring-boot-starter-security'
45-
implementation 'org.springframework.boot:spring-boot-starter-web'
41+
implementation 'org.springframework.boot:spring-boot-starter-undertow'
4642
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
4743
testImplementation 'org.springframework.boot:spring-boot-starter-test'
4844
testImplementation 'org.springframework.security:spring-security-test'
4945
testCompile group: 'org.hamcrest', name: 'java-hamcrest', version: '2.0.0.0'
5046
testCompile("junit:junit")
51-
}
47+
}

settings.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1+
pluginManagement {
2+
repositories {
3+
maven { url 'https://repo.spring.io/snapshot' }
4+
maven { url 'https://repo.spring.io/milestone' }
5+
gradlePluginPortal()
6+
}
7+
resolutionStrategy {
8+
eachPlugin {
9+
if (requested.id.id == 'org.springframework.boot') {
10+
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
11+
}
12+
}
13+
}
14+
}
115
rootProject.name = 'memes-api'
216

src/main/java/com/poprosturonin/SecurityConfig.java

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
management.context-path=/manage
2-
9gag.email=YOUR9GAGEMAIL@pr0gramista.pl
3-
9gag.password=PUT_YOUR_9GAG_PASSWORD
1+
spring.main.lazy-initialization=true

0 commit comments

Comments
 (0)