diff --git a/generators/gradle/generators/jib/templates/buildSrc/src/main/groovy/jhipster.docker-conventions.gradle.ejs b/generators/gradle/generators/jib/templates/buildSrc/src/main/groovy/jhipster.docker-conventions.gradle.ejs index 87530f152cb7..bd5155d6bcfb 100644 --- a/generators/gradle/generators/jib/templates/buildSrc/src/main/groovy/jhipster.docker-conventions.gradle.ejs +++ b/generators/gradle/generators/jib/templates/buildSrc/src/main/groovy/jhipster.docker-conventions.gradle.ejs @@ -21,6 +21,9 @@ plugins { } jib { +<%_ if (backendTypeSpringBoot) { _%> + configurationName = "productionRuntimeClasspath" +<%_ } _%> from { image = "<%- dockerContainers.javaJre %>" platforms { diff --git a/generators/maven/generators/jib/generator.ts b/generators/maven/generators/jib/generator.ts index b981e579fd68..c3cb4253cbe9 100644 --- a/generators/maven/generators/jib/generator.ts +++ b/generators/maven/generators/jib/generator.ts @@ -97,8 +97,31 @@ export default class JibGenerator extends BaseApplicationGenerator { 755 - -`, + ${ + application.backendTypeSpringBoot + ? ` + + + com.google.cloud.tools.jib.maven.extension.springboot.JibSpringBootExtension + + +` + : '' + } +${ + application.backendTypeSpringBoot + ? ` + + + com.google.cloud.tools + jib-spring-boot-extension-maven + ${application.javaDependencies!['jib-spring-boot-extension-maven']} + + +` + : '' + } +`, }, ], }); diff --git a/generators/server/resources/gradle/libs.versions.toml b/generators/server/resources/gradle/libs.versions.toml index cbc71a62c48a..743c994a040c 100644 --- a/generators/server/resources/gradle/libs.versions.toml +++ b/generators/server/resources/gradle/libs.versions.toml @@ -16,6 +16,10 @@ neo4j-migrations-spring-boot-starter = { module = 'eu.michael-simons.neo4j:neo4j # Cassandra lz4-java = { module = 'org.lz4:lz4-java', version = '1.8.0' } +# jib +jib-maven-plugin = { module = 'com.google.cloud.tools:jib-maven-plugin', version = '3.4.3' } +jib-spring-boot-extension-maven = { module = 'com.google.cloud.tools:jib-spring-boot-extension-maven', version = '0.1.0' } + [plugins] gradle-git-properties = { id = 'com.gorylenko.gradle-git-properties', version = '2.4.2' } diff --git a/generators/server/resources/pom.xml b/generators/server/resources/pom.xml index 183c7b8c7a4b..c6050b788f1a 100644 --- a/generators/server/resources/pom.xml +++ b/generators/server/resources/pom.xml @@ -23,7 +23,6 @@ 1.15.0 4.9.6 9.0.1 - 3.4.3 1.0.0 0.8.12 3.1.0 @@ -98,11 +97,6 @@ frontend-maven-plugin ${frontend-maven-plugin.version} - - com.google.cloud.tools - jib-maven-plugin - ${jib-maven-plugin.version} - com.puppycrawl.tools checkstyle