<p>I am following tutorial: <a href="https://codelabs.developers.google.com/codelabs/cloud-springboot-kubernetes?continue=https%3A%2F%2Fdevelopers.google.com%2Flearn%2Fpathways%2Fspringboot-google-cloud%23codelab-https%3A%2F%2Fcodelabs.developers.google.com%2Fcodelabs%2Fcloud-springboot-kubernetes#4" rel="nofollow noreferrer">https://codelabs.developers.google.com/codelabs/cloud-springboot-kubernetes?continue=https%3A%2F%2Fdevelopers.google.com%2Flearn%2Fpathways%2Fspringboot-google-cloud%23codelab-https%3A%2F%2Fcodelabs.developers.google.com%2Fcodelabs%2Fcloud-springboot-kubernetes#4</a> for Deployin a Spring Boot Java app to Kubernetes on Google Kubernetes Engine. I have my own sourcecode which is based on gradle and not on maven.
I got stuck on the command:</p>
<pre><code>./mvnw -DskipTests com.google.cloud.tools:jib-maven-plugin:build -Dimage=us-central1-docker.pkg.dev/${GOOGLE_CLOUD_PROJECT}/codelabrepo/hello-java:v1
</code></pre>
<p>I have replaced it with:</p>
<pre><code>./gradlew   com.google.cloud.tools:jib-maven-plugin:build -Dimage=us-central1-docker.pkg.dev/${GOOGLE_CLOUD_PROJECT}/codelabrepo/hello-java:v1
</code></pre>
<p>But i am getting an error:</p>
<pre><code>FAILURE: Build failed with an exception.

* What went wrong:
Cannot locate tasks that match 'com.google.cloud.tools:jib-maven-plugin:build' as project 'com.google.cloud.tools' not found in root project 'questy'.
</code></pre>
<p>My gradle file looks:</p>
<pre><code>plugins {
    id 'java'
    id 'org.springframework.boot' version '3.1.0'
    id 'io.spring.dependency-management' version '1.1.0'
}

group = 'org.bbbb'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'


repositories {
    mavenCentral()
}
 

dependencyManagement {
    dependencies {
        dependency group: 'com.google.cloud', name: 'spring-cloud-gcp-dependencies', version: '4.1.4', type: &quot;pom&quot;, scope: &quot;import&quot;
    }
}
dependencyManagement {
    imports {
        mavenBom &quot;com.google.cloud:spring-cloud-gcp-dependencies:4.1.4&quot;
    }
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}
dependencies {
    implementation 'com.google.cloud:spring-cloud-gcp-starter-sql-mysql'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    runtimeOnly 'com.mysql:mysql-connector-j'
 
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
    useJUnitPlatform()
}
</code></pre>
<p>How can I create the container image and push it to the Artifact Registry? Should I add something to my build.gradle file? or should I run the command in another way?</p>

fascynacja
<p>Obviously, your Gradle usage is wrong, and you didn't even seem to have set up Jib. I suggest you follow the <a href="https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin#quickstart" rel="nofollow noreferrer">Jib Quickstart guide</a>.</p>
