#1777  Configuring OneDev to use shared maven cache
Closed
andrzej opened 2 months ago

I've followed the example of configuring maven cache in onedev jobs as it done in onedev/server repository. I've done that for a few projects that very often have the same subset of dependencies. I've seen separate caches for each project that have different sizes. I've also defined Cache Load Keys as maven-repository so that shared dependecies would be placed in a single copy in this cache. However, I cannot find this cache.

Is it visible some where? As we do have a lot of small projects depending on other projects, having shared caches between them would be good for us. Did I miss something in my configuration?

andrzej commented 2 months ago
Robin Shen commented 2 months ago

Cache can now only be shared within same project for security reason.

andrzej commented 2 months ago

In our case, this will lead to a lot of duplication of data in caches. I do understand that modification of shared cache (or saving to it newly generate artifacts) may cause issues with build of other projects using the same cache.

I was expecting that there would be something like shared cache between parent project and child projects, especially as maven cache is mostly filled with dependencies fetched from remote repositories.

As I think longer about that, I think that it would even work for us without local cache but with maven repository proxy cache. Have you considered adding that to OneDev?

With feature like that most of Maven based projects could work without local maven cache. Instead, projects would fetch maven artifacts using maven repository proxy that would cache fetched artifacts.

Robin Shen commented 2 months ago

Allowing cache sharing between parent/child projects can be complicated, for instance, where a cache should be stored, in current project, or in parent project. For a particular cache, which project is allowed to overwrite it, etc.

The maven proxy feature is more convenient in this case. I filed a feature request as #1783

Robin Shen changed state to 'Closed' 2 months ago
Previous Value Current Value
Open
Closed
Robin Shen commented 5 days ago

Cache step is improved in build #4966 (10.5.0) to be able to upload cache to parent project, so that it can be shared to child projects. Combined with the the upload strategy, it should be able to solve the problem you raised.

issue 1 of 1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
onedev/server#1777
Please wait...
Page is in error, reload to recover