github.com/GoogleContainerTools/skaffold/v2@v2.13.2/examples/jib-multimodule/README.md (about)

     1  ### Example: Jib Multi-Module
     2  
     3  [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/GoogleContainerTools/skaffold&cloudshell_open_in_editor=README.md&cloudshell_workspace=examples/jib-multimodule)
     4  
     5  [Jib](https://github.com/GoogleContainerTools/jib) is one of the supported builders in Skaffold.
     6  It builds Docker and OCI images
     7  for your Java applications and is available as plugins for Maven and Gradle.
     8  
     9  Sometimes a project is configured to have multiple _modules_ to create several
    10  container images.  Skaffold can work with Jib to build these containers as
    11  required.
    12  
    13  The way you configure it in `skaffold.yaml` is the following build stanza:
    14  
    15  ```yaml
    16  build:
    17       artifacts:
    18       - image: skaffold-jib-1
    19         # context is the root of the multi-module project
    20         context: .
    21         jib:
    22            # project is the location relative to the artifact `context`
    23            # For Maven, this is either the path relative to the artifact's
    24            # `context`, or `:artifactId` or `groupId:artifactId`.
    25            # For Gradle, this is the project name (defaults to the
    26            # directory name).
    27            project: moduleLocation
    28       - image: skaffold-jib-2
    29         context: .
    30         jib:
    31            project: :artifactId
    32  ```
    33  
    34  There are a few caveats:
    35  
    36  - The `jib-maven-plugin` must be either be configured referenced in the
    37  root module of the project.  This is easily done through a `pluginManagement`
    38  block.
    39  
    40  - The artifact modules must have a `jib:xxx` goal bound to the `package` phase.