Skip to content
The Chat Archive
claude-3-7-sonnet-20250219· Anthropic LMArena Human Preference 140K

I have this gitlab pipeline config file the mvn test is downloading all the packages,…

  1. 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

  2. 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 test command 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?

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.