question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jib packages spring boot devtools

See original GitHub issue

Environment:

  • Jib version: 2.1.0
  • Build tool: maven
  • OS: macos

Description of the issue: I created a Spring Boot app w/ devtools dependency:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-devtools</artifactId>
  <scope>runtime</scope>
  <optional>true</optional>
</dependency>

In the resulting image, devtool is actually activated. The dependency is in the image’s /app/libs directory.

Expected behavior: Optional dependency ignored? Spring Boot’s plugin excludes devtool by default. https://docs.spring.io/spring-boot/docs/2.2.5.RELEASE/maven-plugin/repackage-mojo.html

Steps to reproduce:

  1. Create a new spring boot app w/ devtool
  2. Package w/ Jib
  3. See that Jib includes Devtool

jib-maven-plugin Configuration:

<plugin>
  <groupId>com.google.cloud.tools</groupId>
  <artifactId>jib-maven-plugin</artifactId>
  <version>2.1.0</version>
  <configuration>
    <from><image>openjdk:8u222-slim</image></from>
    <to><image>gcr.io/wise-coyote-827/jib-demo</image></to>
    <container><user>nobody:nogroup</user></container></configuration>
</plugin>

Log output:

Additional Information:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
chanseokohcommented, Jul 27, 2020

We have published a Jib extension for Spring Boot (Maven and Gradle) that covers this issue. You can apply the extension on recent Jib versions.

Details

As discussed in this thread and #1254, Jib is working as intended to package spring-boot-devtools in the image, and the user should properly configure the dependency if they do not want it at runtime. However, we decided to create the extension to help people avoid the chore of manually setting up profiles in their projects.

4reactions
goto1134commented, Aug 9, 2021

update: use jib-spring-boot-extension to exclude spring-boot-devtools

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot DevTools being used inside docker container ...
We use the Jib plugin to monitor create docker images and run them. We use gradle to build the project and there dev...
Read more >
Spring DevTools with Jib and IntelliJ IDEA - A Java geek
To distribute Spring Boot apps in Docker containers, I'm using the Maven Jib plugin. Jib is able to create Docker images, without the...
Read more >
Developing with Spring Boot
This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, ...
Read more >
Jib vs. Spring Boot for building Docker images - Tom Gregory
Jib is a tool from Google, specifically designed to generate Docker images from a jar file. Importantly, it creates a layered Docker image...
Read more >
Spring Boot - DevTools - GeeksforGeeks
Spring Boot – DevTools · 1. Automatic application restart. With DevTools when we make changes to Java code or properties file, the application ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found