Skip to content

Jib dependency refresh fails in gradle 9 multi module project when including dependency on other moduleΒ #4469

@Kretiss

Description

@Kretiss

Environment:

  • Jib version: 3.5.2
  • Build tool: Gradle 9.2.1
  • OS: MacOs 26.2

Description of the issue:
Skaffold fails to start with Jib in multi module project, because it tries to access non existent function getDependencyProject(), which was removed with release of gradle v9. See https://docs.gradle.org/8.11.1/userguide/upgrading_version_8.html#deprecate_get_dependency_project.

Expected behavior:
Use project.project(projectDependency.path) instead of projectDependency.dependencyProject in gradle 9.

Steps to reproduce:

  1. create a minimal multi modules Gradle 9.2.1 wrapper project
  2. add the id 'com.google.cloud.tools.jib' version '3.5.2' plugin
  3. try to include dependency on module

build.gradle

plugins {
    id 'java'
    id 'org.springframework.boot' version '4.0.0'
    id 'com.google.cloud.tools.jib' version '3.5.2'
    ....
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(25)
    }
}

dependencies {
    implementation project(":common") // here is the problem

    implementation 'org.springframework.boot:spring-boot-starter'
    ....
}

....

Log output:
stderr: "\nFAILURE: Build failed with an exception.\n\n* What went wrong:\nExecution failed for task ':services:user-service:_jibSkaffoldFilesV2'.\n> 'org.gradle.api.Project org.gradle.api.artifacts.ProjectDependency.getDependencyProject()'\n\n* Try:\n> Run with --stacktrace option to get the stack trace.\n> Run with --info or --debug option to get more log output.\n> Run with --scan to generate a Build Scan (powered by Develocity).\n> Get more help at https://help.gradle.org.\n\nBUILD FAILED in 484ms\n"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions