Skip to content

Commit

Permalink
Merge pull request #27063 from mshima/jib
Browse files Browse the repository at this point in the history
don't include devtools in docker image.
  • Loading branch information
DanielFran committed Aug 25, 2024
2 parents 58c22bd + 61f58f5 commit bbf2d5f
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 36 deletions.
3 changes: 3 additions & 0 deletions generators/app/__snapshots__/generator.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ exports[`generator - app with default config should match snapshot 1`] = `
"jacoco-maven-plugin": "'JACOCO-MAVEN-PLUGIN-VERSION'",
"jhipster-dependabot": "'JHIPSTER-DEPENDABOT-VERSION'",
"jib-maven-plugin": "'JIB-MAVEN-PLUGIN-VERSION'",
"jib-spring-boot-extension-maven": "'JIB-SPRING-BOOT-EXTENSION-MAVEN-VERSION'",
"lifecycle-mapping": "'LIFECYCLE-MAPPING-VERSION'",
"lz4-java": "'LZ-4-JAVA-VERSION'",
"mapstruct": "'MAPSTRUCT-VERSION'",
Expand Down Expand Up @@ -1129,6 +1130,7 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"jacoco-maven-plugin": "'JACOCO-MAVEN-PLUGIN-VERSION'",
"jhipster-dependabot": "'JHIPSTER-DEPENDABOT-VERSION'",
"jib-maven-plugin": "'JIB-MAVEN-PLUGIN-VERSION'",
"jib-spring-boot-extension-maven": "'JIB-SPRING-BOOT-EXTENSION-MAVEN-VERSION'",
"lifecycle-mapping": "'LIFECYCLE-MAPPING-VERSION'",
"lz4-java": "'LZ-4-JAVA-VERSION'",
"mapstruct": "'MAPSTRUCT-VERSION'",
Expand Down Expand Up @@ -1743,6 +1745,7 @@ exports[`generator - app with microservice should match snapshot 1`] = `
"jacoco-maven-plugin": "'JACOCO-MAVEN-PLUGIN-VERSION'",
"jhipster-dependabot": "'JHIPSTER-DEPENDABOT-VERSION'",
"jib-maven-plugin": "'JIB-MAVEN-PLUGIN-VERSION'",
"jib-spring-boot-extension-maven": "'JIB-SPRING-BOOT-EXTENSION-MAVEN-VERSION'",
"lifecycle-mapping": "'LIFECYCLE-MAPPING-VERSION'",
"lz4-java": "'LZ-4-JAVA-VERSION'",
"mapstruct": "'MAPSTRUCT-VERSION'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jib-plugin = { module = "com.google.cloud.tools:jib-gradle-plugin", version = "'
}
jib {
configurationName = "productionRuntimeClasspath"
from {
image = "java-jre-placeholder"
platforms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ plugins {
}

jib {
<%_ if (backendTypeSpringBoot) { _%>
configurationName = "productionRuntimeClasspath"
<%_ } _%>
from {
image = "<%- dockerContainers.javaJre %>"
platforms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,22 @@ exports[`generator - java:jib with defaults options should match source snapshot
</permission>
</permissions>
</extraDirectories>
</configuration>",
<pluginExtensions>
<pluginExtension>
<implementation>com.google.cloud.tools.jib.maven.extension.springboot.JibSpringBootExtension</implementation>
</pluginExtension>
</pluginExtensions>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-spring-boot-extension-maven</artifactId>
<version>'JIB-SPRING-BOOT-EXTENSION-MAVEN-VERSION'</version>
</dependency>
</dependencies>
",
"artifactId": "jib-maven-plugin",
"groupId": "com.google.cloud.tools",
"version": "\${jib-maven-plugin.version}",
Expand Down
27 changes: 25 additions & 2 deletions generators/maven/generators/jib/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,31 @@ export default class JibGenerator extends BaseApplicationGenerator {
<mode>755</mode>
</permission>
</permissions>
</extraDirectories>
</configuration>`,
</extraDirectories>${
application.backendTypeSpringBoot
? `
<pluginExtensions>
<pluginExtension>
<implementation>com.google.cloud.tools.jib.maven.extension.springboot.JibSpringBootExtension</implementation>
</pluginExtension>
</pluginExtensions>
`
: ''
}
</configuration>${
application.backendTypeSpringBoot
? `
<dependencies>
<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-spring-boot-extension-maven</artifactId>
<version>${application.javaDependencies!['jib-spring-boot-extension-maven']}</version>
</dependency>
</dependencies>
`
: ''
}
`,
},
],
});
Expand Down
4 changes: 4 additions & 0 deletions generators/server/resources/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }

Expand Down
6 changes: 0 additions & 6 deletions generators/server/resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<frontend-maven-plugin.version>1.15.0</frontend-maven-plugin.version>
<gatling-maven-plugin.version>4.9.6</gatling-maven-plugin.version>
<git-commit-id-maven-plugin.version>9.0.1</git-commit-id-maven-plugin.version>
<jib-maven-plugin.version>3.4.3</jib-maven-plugin.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
Expand Down Expand Up @@ -98,11 +97,6 @@
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
Expand Down
34 changes: 7 additions & 27 deletions generators/spring-boot/templates/pom.xml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,13 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
</execution>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
Expand Down Expand Up @@ -618,17 +625,6 @@
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
Expand Down Expand Up @@ -778,22 +774,6 @@
</properties>
<build>
<finalName>e2e</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<%_ } _%>
Expand Down

0 comments on commit bbf2d5f

Please sign in to comment.