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.

No reload with skaffold dev on Kotlin code when using Jib with Java + Kotlin

See original GitHub issue

Expected behavior

I am expecting the skaffold dev to reload a new “version” of the app on each modification of a java + kotlin project built with Jib.

Actual behavior

The skaffold dev doesn’t detect any changes on the file system when I change code in the Kotlin part.

Information

  • Skaffold version: v0.37.1
  • Operating system: macOS
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta13
kind: Config
build:
  artifacts:
    - image: podcastserver/backend
      context: backend
      jibMaven:
        args:
          - liquibase:dropAll
          - liquibase:update
          - jooq-codegen:generate
          - compile
          - -Dmaven.test.skip
deploy:
  kustomize:
    path: backend/src/main/k8s/docker-for-mac/

Extra information:

I’ve dug a little into the skaffold and jib implementation and found out skaffold execute the following command to define files to watch:

mvn jib:_skaffold-files-v2 -q

And the current result for this command is the following in my project:

{
  "build": [
    "/Users/kevin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend/pom.xml"
  ],
  "inputs": [
    "/Users/kevin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend/src/main/java",
    "/Users/kevin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend/src/main/resources",
    "/Users/kevin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend/src/main/resources",
    "/Users/kevin/Workspace/gitlab.com/davinkevin/Podcast-Server/backend/src/main/jib"
  ],
  "ignore": []
}

So, it seems to only look for files into src/main/java. I don’t know if my project follows the “maven state of the art configuration for Java + Kotlin”, but I didn’t find any information about this use case.

It should be good to be able to configure manually or take some folder if they exist.

PS: I think the title of the issue is very bad, but I didn’t find anything better, so I let you change it if you have a better idea !

Steps to reproduce the behavior

  1. git clone git@gitlab.com:davinkevin/Podcast-Server.git (or git clone https://gitlab.com/davinkevin/Podcast-Server.git if it doesn’t work)
  2. cd podcast-server
  3. ./dev.sh which trigger some file system init (in /tmp folder) required by the app and then launch a skaffold dev command
  4. Do any modification on a file located inside backend/src/main/kotlin/... and see there is no “reload” from the skaffold dev command.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
chanseokohcommented, Sep 18, 2019

#2010 makes jib:_skaffold-files-v2 to extract path values from <sourceDir> configured on the Kotlin Maven plugin. The next Jib version will support this use case.

Haven’t looked into the Gradle side. I’ll re-open the issue for tracking.

1reaction
davinkevincommented, Oct 26, 2019

All is working perfectly 🎉with skaffold 0.41.0 and jib 1.7.0. Thanks to all

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jib Build - Skaffold
Skaffold can help build artifacts using Jib; Jib builds the container images and then pushes them to the local Docker daemon or to...
Read more >
Local Java Development on Kubernetes - Piotr's TechBlog
In this article, you will learn how to use tools like Skaffold or Jib in local development of Java applications on Kubernetes.
Read more >
Containerizing Java Applications with Jib - InfoQ
This integration enables Skaffold's zero-config auto sync for Java images. With auto sync, Jib can sync class file changes and resource file ...
Read more >
Building and Deploying Containerized Application to ...
Jib allow Java/Kotlin developers to integrate the step of containerization using their tools of choice like Maven or Gradle by adding a ...
Read more >
Continuous Development with Java and Kubernetes
Using Jib for docker image creation. Jib is implemented in Java and runs as part of your Maven or Gradle build. You do...
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