Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add jib.skip configuration option to the gradle plugin #3537

Closed
wlchan opened this issue Dec 20, 2021 · 3 comments
Closed

Comments

@wlchan
Copy link

wlchan commented Dec 20, 2021

Environment:

  • Grade plugin: 3.1.4
  • Build tool: Gradle version 6.5.1
  • OS: MacOS

Description of the issue:
In Jib maven plugin, there is a configuration option for jib.skip to skip executing Jib in library module in a multi-module project. Original request for this feature in maven plugin: #865
This option is not available in Gradle plugin

Expected behavior:
jib.skip configuration option is also available to gradle plugin. Yes, I know I can do :{service}:jib but it may not be an option in a CI/CD with standardize pipeline build process.

Steps to reproduce:

  1. Add jib.skip into build.gradle in module directory (e.g. client-lib)
  2. Run ./gradlew build jib
  3. Jib task should ignore client-lib module

build.gradle Configuration:

jib {
   skip = true
}

Log output:

What went wrong:
A problem occurred evaluating project ':client-lib'.
Could not set unknown property 'skip' for extension 'jib' of type com.google.cloud.tools.jib.gradle.JibExtension.

@ddixit14
Copy link

Hi @wlchan, thank you for raising this feature request. We'll look into this 👍🏻

@chanseokoh
Copy link
Member

chanseokoh commented Jan 4, 2022

The jib.skip-like feature is already doable with Gradle. (In fact, anything is possible in Gradle.) You can just disable whatever tasks in question (whether jib, jibDockerBuild, or jibBuildTar) by setting enabled to false.

However, if you find yourself wanting to do that, it's likely that your project setup is not correct. Just don't apply the Jib plugin to the library module. jib.skip is only there for Maven, due to the particular way Maven works as discussed in #865. As explained in this FAQ, you should structure your project in this way:

define all of your plugins in the base project and apply them selectively in your subprojects as needed.

@JunlinHe
Copy link

tasks.findByName("jib").setEnabled(false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants