How to enable maven artifact caching for gitlab ci runner?

后端 未结 8 1829
星月不相逢
星月不相逢 2020-12-12 17:14

We use gitlab ci with shared runners to do our continuous integration. For each build, the runner downloads tons of maven artifacts.

Is there a way to configure gitl

8条回答
  •  囚心锁ツ
    2020-12-12 17:46

    The accepted answer didn't do it for me.

    As zlobster mentioned, the guys at GitLab have this amazing repository where you can find a proper example of the .gitlab-ci.yml file used for Maven projects.

    Basically, what you need are these lines:

    cache:
      paths:
        - .m2/repository
    

    Keep in mind that if you decide to a add a local cache for a certain job, the global one added above will be replaced. More on this here.

提交回复
热议问题