public static String getSkaffoldSyncMap(
      RawConfiguration rawConfiguration, ProjectProperties projectProperties, Set<Path> excludes)
      throws IOException, InvalidCreationTimeException, InvalidImageReferenceException,
          IncompatibleBaseImageJavaVersionException, InvalidPlatformException,
          InvalidContainerVolumeException, MainClassInferenceException, InvalidAppRootException,
          InvalidWorkingDirectoryException, InvalidFilesModificationTimeException,
          InvalidContainerizingModeException, ExtraDirectoryNotFoundException {
    JibContainerBuilder jibContainerBuilder =
        processCommonConfiguration(
            rawConfiguration, ignored -> Optional.empty(), projectProperties);
    SkaffoldSyncMapTemplate syncMap = new SkaffoldSyncMapTemplate();
    // since jib has already expanded out directories after processing everything, we just
    // ignore directories and provide only files to watch
    Set<Path> excludesExpanded = getAllFiles(excludes);
    for (LayerObject layerObject : jibContainerBuilder.toContainerBuildPlan().getLayers()) {
      Verify.verify(
          layerObject instanceof FileEntriesLayer,
          "layer types other than FileEntriesLayer not yet supported in build plan layers");
      FileEntriesLayer layer = (FileEntriesLayer) layerObject;
      if (CONST_LAYERS.contains(layer.getName())) {
        continue;
      }
      if (GENERATED_LAYERS.contains(layer.getName())) {
        layer.getEntries().stream()
            .filter(layerEntry -> Files.isRegularFile(layerEntry.getSourceFile()))
            .filter(
                layerEntry ->
                    !excludesExpanded.contains(layerEntry.getSourceFile().toAbsolutePath()))
            .forEach(syncMap::addGenerated);
      } else { // this is a direct layer
        layer.getEntries().stream()
            .filter(layerEntry -> Files.isRegularFile(layerEntry.getSourceFile()))
            .filter(
                layerEntry ->
                    !excludesExpanded.contains(layerEntry.getSourceFile().toAbsolutePath()))
            .forEach(syncMap::addDirect);
      }
    }
    return syncMap.getJsonString();
  }
Generate a skaffold syncmap JSON string for an image build configuration.

@param rawConfiguration the raw configuration from the plugin
@param projectProperties an plugin specific implementation of {@link ProjectProperties}
@param excludes a set of paths to exclude, directories include in this list will be expanded
@return new json string representation of the Sync Map
@throws InvalidImageReferenceException if the image reference is invalid
@throws MainClassInferenceException if a main class could not be found
@throws InvalidAppRootException if the specific path for application root is invalid
@throws IOException if an error occurs creating the container builder
@throws InvalidWorkingDirectoryException if the working directory specified for the build is
    invalid
@throws InvalidPlatformException if there exists a {@link PlatformConfiguration} in the
    specified platforms list that is missing required fields or has invalid values
@throws InvalidContainerVolumeException if a specific container volume is invalid
@throws IncompatibleBaseImageJavaVersionException if the base image java version cannot support
    this build
@throws NumberFormatException if a string to number conversion operation fails
@throws InvalidContainerizingModeException if an invalid {@link ContainerizingMode} was
    specified
@throws InvalidFilesModificationTimeException if configured modification time could not be
    parsed
@throws InvalidCreationTimeException if configured creation time could not be parsed
@throws ExtraDirectoryNotFoundException if the extra directory specified for the build is not
    found
jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java