I have this a Spring Boot application with the following configurations
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<image>
<builder>paketobuildpacks/builder:tiny</builder>
<name>test.com/microservice/${project.artifactId}:${project.version}</name>
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
<publish>true</publish>
<env>
<BP_NATIVE_IMAGE>false</BP_NATIVE_IMAGE>
<BPL_DEBUG_ENABLED>false</BPL_DEBUG_ENABLED>
<!--<JAVA_TOOL_OPTIONS></JAVA_TOOL_OPTIONS>-->
</env>
</image>
<docker>
<publishRegistry>
<username>test</username>
<password>test</password>
<url>https://test.com</url>
</publishRegistry>
</docker>
</configuration>
</plugin>
</plugins>
</build>
And .gitlab-cy.yml
image: test.com/docker:18.06
services:
- name: test.com/docker:dind
variables:
DOCKER_DRIVER: overlay
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
maven-build:
image: test.com/maven:3.6.3-openjdk-17-slim
stage: build
tags:
- shared-runner
only:
- staging
- master
script:
- mvn -DAPP_VERSION=${CI_COMMIT_SHA:0:8} $MAVEN_CLI_OPTS clean spring-boot:build-image -DskipTests
Always when job is run
paketobuilder download BellSoft Liberica JRE 17.0.4
logs
5221 [INFO] [creator] $JAVA_TOOL_OPTIONS the JVM launch flags
5222 [INFO] [creator] Using Java version 17.* from BP_JVM_VERSION
5222 [INFO] [creator] BellSoft Liberica JRE 17.0.4: Contributing to layer
5222 [INFO] [creator] Downloading from https://github.com/bell-sw/Liberica/releases/download/17.0.4+8/bellsoft-jre17.0.4+8-linux-amd64.tar.gz
111299 [INFO] [creator] Verifying checksum
111455 [INFO] [creator] Expanding to /layers/paketo-buildpacks_bellsoft-liberica/jre
How Can I cache these downloads in gitlab runner?