/** * Adds a new layer to the container with {@code files} as the source files and {@code * pathInContainer} as the path to copy the source files to in the container file system. * * @param files the source files to copy to a new layer in the container * @param pathInContainer the path in the container file system corresponding to the {@code * sourceFile} * @return this * @throws IOException if an exception occurred when recursively listing any directories * @throws IllegalArgumentException if {@code pathInContainer} is not an absolute Unix-style path * @see #addLayer(List, AbsoluteUnixPath) */ public JibContainerBuilder addLayer(List<Path> files, String pathInContainer) throws IOException { return addLayer(files, AbsoluteUnixPath.get(pathInContainer)); }
return addLayer(layerConfigurationBuilder.build());
/** * Adds a new layer to the container with {@code files} as the source files and {@code * pathInContainer} as the path to copy the source files to in the container file system. * * @param files the source files to copy to a new layer in the container * @param pathInContainer the path in the container file system corresponding to the {@code * sourceFile} * @return this * @throws IOException if an exception occurred when recursively listing any directories * @throws IllegalArgumentException if {@code pathInContainer} is not an absolute Unix-style path * @see #addLayer(List, AbsoluteUnixPath) */ public JibContainerBuilder addLayer(List<Path> files, String pathInContainer) throws IOException { return addLayer(files, AbsoluteUnixPath.get(pathInContainer)); }
/** * Adds a new layer to the container with {@code files} as the source files and {@code * pathInContainer} as the path to copy the source files to in the container file system. * * @param files the source files to copy to a new layer in the container * @param pathInContainer the path in the container file system corresponding to the {@code * sourceFile} * @return this * @throws IOException if an exception occurred when recursively listing any directories * @throws IllegalArgumentException if {@code pathInContainer} is not an absolute Unix-style path * @see #addLayer(List, AbsoluteUnixPath) */ public JibContainerBuilder addLayer(List<Path> files, String pathInContainer) throws IOException { return addLayer(files, AbsoluteUnixPath.get(pathInContainer)); }
return addLayer(layerConfigurationBuilder.build());
return addLayer(layerConfigurationBuilder.build());
.distinct() .sorted(comparing(Layer::getSize).reversed()) .peek(it -> builder.addLayer(it.layerConfiguration)) .peek(it -> getLog().info("Prepared layer for '" + it.gav + "' dependencies (" + toSize(it.size) + ")")) .map(it -> it.gav) .addEntry(registryLocation.toPath().toAbsolutePath(), AbsoluteUnixPath.get(workingDirectory).resolve(registryLocation.getName())); builder.addLayer(componentsLayerBuilder.build()); getLog() .info("Prepared layer for components " + cars.toString().replace(":car", "") + " (" }) .collect(toList()); builder.addLayer(dependenciesLayer.build()); getLog().info("Prepared layer for main dependencies (" + toSize(mainDepSize.get()) + ")"); classpath.add(mainPath.toString()); builder .addLayer(LayerConfiguration .builder() .setName(project.getArtifactId() + " @" + project.getVersion())