Skip to content

Commit

Permalink
Added Spring Native Aot
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Dec 27, 2021
1 parent 9d2fe01 commit f8620e6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
novaVersion = '3.0.0'
springBootVersion = '2.6.2'
autoServiceVersion = '1.0.1'
springDocVersion = '1.5.12'
springDocVersion = '1.6.0'
}
}

Expand Down Expand Up @@ -47,8 +47,6 @@ allprojects {
}
}
maven { url 'https://repo.spring.io/release' }
maven { url 'https://repo.spring.io/milestone' }
maven { url 'https://repo.spring.io/snapshot' }
}
}

Expand Down
9 changes: 7 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ FROM eclipse-temurin:${JVM_VERSION}-jdk-focal AS extractor

WORKDIR /src

COPY --from=builder /src/luna-main/build/libs/luna-main-*.jar luna.jar
RUN java -Djarmode=layertools -jar luna.jar extract
COPY --from=builder /src/luna-main/build/libs/luna-main-*.jar .

RUN rm -rf ./luna-main-*-all.jar ./luna-main-*-plain.jar ./luna-main-*-aot.jar \
&& mv luna-main-*.jar luna.jar \
&& java -Djarmode=layertools -jar luna.jar extract


FROM ubuntu:focal

Expand Down Expand Up @@ -76,6 +80,7 @@ ENV JAVA_APP_DIR=${DATA_DIR}
ENV JAVA_MAIN_CLASS=org.springframework.boot.loader.JarLauncher
ENV JAVA_APP_NAME=luna
ENV JAVA_CLASSPATH=/opt/luna
ENV JAVA_OPTIONS="-DspringAot=true"

USER ${LUNA_USER}:${LUNA_GROUP}
VOLUME ${DATA_DIR}
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.github-actions
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ FROM eclipse-temurin:${JVM_VERSION}-jdk-focal AS extractor
WORKDIR /src

COPY ./luna-main-*.jar .
RUN rm -rf ./luna-main-*-all.jar ./luna-main-*-plain.jar \
&& ls \
RUN rm -rf ./luna-main-*-all.jar ./luna-main-*-plain.jar ./luna-main-*-aot.jar \
&& mv luna-main-*.jar luna.jar \
&& java -Djarmode=layertools -jar luna.jar extract

Expand Down Expand Up @@ -66,6 +65,7 @@ ENV JAVA_APP_DIR=${DATA_DIR}
ENV JAVA_MAIN_CLASS=org.springframework.boot.loader.JarLauncher
ENV JAVA_APP_NAME=luna
ENV JAVA_CLASSPATH=/opt/luna
ENV JAVA_OPTIONS="-DspringAot=true"

USER ${LUNA_USER}:${LUNA_GROUP}
VOLUME ${DATA_DIR}
Expand Down
10 changes: 5 additions & 5 deletions luna-main/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
// id 'com.palantir.graal'
id 'org.springframework.boot'
id 'com.github.johnrengelman.shadow'
// id 'org.springframework.experimental.aot'
id 'org.springframework.experimental.aot'
}

dependencies {
Expand All @@ -11,14 +11,14 @@ dependencies {
implementation("de.m4rc3l.nova:nova-core:${novaVersion}") { changing true }

runtimeOnly project(':luna-cacti')
runtimeOnly project(':luna-dvb')
runtimeOnly project(':luna-weather')
// runtimeOnly project(':luna-dvb')
// runtimeOnly project(':luna-weather')

runtimeOnly 'org.postgresql:postgresql'
// runtimeOnly 'org.liquibase:liquibase-core'

implementation "org.springdoc:springdoc-openapi-webflux-ui:${springDocVersion}"
// implementation "org.springdoc:springdoc-openapi-native:${springDocVersion}"
implementation "org.springdoc:springdoc-openapi-native:${springDocVersion}"
implementation 'org.springframework.boot:spring-boot-starter-actuator'

implementation platform('io.sentry:sentry-bom:5.3.0')
Expand All @@ -28,7 +28,7 @@ dependencies {
// runtimeOnly 'io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.8.Final:linux-x86_64'
// runtimeOnly 'io.netty:netty-tcnative-boringssl-static'

developmentOnly 'org.springframework.boot:spring-boot-devtools'
// developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.springframework:spring-context-indexer'
// testImplementation 'org.springframework.boot:spring-boot-starter-test'
Expand Down

0 comments on commit f8620e6

Please sign in to comment.