I have this gitlab pipeline config file the mvn test is downloading all the packages,…
- User
I have this gitlab pipeline config file the mvn test is downloading all the packages, but I want to use the build from before. how can i make it work?
image: maven:3.9.9-eclipse-temurin-21-alpine stages:
- build
- test
- package
build-job: stage: build script: - mvn clean package -DskipTests artifacts: paths: - target/ expire_in: 1 hour
test-job: stage: test script: - mvn test dependencies: - build-job
- Assistant
You need to modify your test-job to use the artifacts from the build-job instead of running a full Maven download again. The issue is that even though you've specified the dependency, your
mvn testcommand is still trying to download everything.Try this modification:
image: maven:3.9.9-eclipse-temurin-21-alpine stages: - build - test - package build-job: stage: build script: - mvn clean package -DskipTests artifacts: paths: - target/ - .m2/ expire_in: 1 hour cache: paths: - .m2/repository/ test-job: stage: test script: - mvn test -o dependencies: - build-job cache: paths: - .m2/repository/Would you like me to explain the changes I made to the configuration?
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.