Home > OS >  Integration with JIB Gradle cause compilation error
Integration with JIB Gradle cause compilation error

Time:10-13

Tring to integrate with JIB (Containerize your Gradle Java project) with my Java project.

Following this documentation: https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin

Added the following to my project:

dependencies {
  classpath("gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:3.1.4")
}
apply plugin: 'com.google.cloud.tools.jib'
jib.to.image = 'my-docker-local/my-app'

Gradle version is: 5.6.4

The compilation with "./gradlew" build is working fine. but, when excecuting "gradle jib" getting the following error:

gradle jib To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon. Daemon will be stopped at the end of the build

FAILURE: Build failed with an exception.

  • Where: Build file '/Users/igorgumush/dev/java11/my-service/build.gradle' line: 139

  • What went wrong: A problem occurred evaluating root project 'my-service'.

Could not find method compile() for arguments [org.springframework.boot:spring-boot-starter-web, build_9nl2gys0kuhc8m4mdlq51u41r$_run_closure4$_closure24@6ea6088b] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

CodePudding user response:

Well the solution was very simple. I used:

./gradlew jib

instead of

grade jib
  • Related