This message was deleted.
# community-support
s
This message was deleted.
a
What repos have you defined at the moment? If you define multiple repos, then Gradle will check each in turn.
btw, can I ask why you'd like to use Maven Local? I avoid it because it has a few downsides
j
My issue is basically this issue https://issues.gradle.org/browse/GRADLE-2034# though I see a special fix was put in for maven local 🤔 As for why, it's a little awkward, basically we use a privately hosted nexus, and it sucks, and I was hoping to have a bundle of all the dependencies to minimise usage of nexus in our cicd
a
Ahh okay. Maybe there's a better workaround... what about it sucks? Is it slow, or does it often contain corrupted artifacts?
j
We use the free variant which is based on an orientdb database and there are some known limitations there https://help.sonatype.com/en/sonatype-nexus-repository-system-requirements.html
Copy code
OrientDB is unsuitable for use beyond 20K requests per day
and we have more like 300k and yes it struggles, it would be nice to make our cicd not talk to it much because at that point there wouldn't be much load on it and it would probably be reliable - making the people who need to talk to it from their laptops, who ask for a lot less volume, happy
https://github.com/gradle/gradle/blob/master/platforms/software/dependency-managem[…]artifacts/repositories/DefaultMavenLocalArtifactRepository.java It's a shame, I see now it's 'nearly' working, it's just that they've only accounted for the case of poms with no jars, but not for when there's a pom, and a jar, but no test jar 😞. I guess this is why the ticket got closed as being fixed for maven local And I guess this logic runs at the wrong time, because of course I only want to say to ignore a pom in the event it later goes to try to find a test jar
v
I don't think using maven local is a good idea. For one, it has various quirks as Adam linked you to. And it also is broken by design in Maven already as it is used as a mixture of download cache and repository. Once Gradle found a POM in a repository, it expects that the entry in the repository is complete with all artifacts and Gradle Modue Metadata and so on and will not look for single artifacts in other repositories. It would als be quite dangerous if it would, so it is a good thing it doesn't. Afaik, there is no way to make maven local look for artifacts in other repositories if it doesn't find them. Maybe you could abuse an Ivy repository that you configure to point to the maven local repository and also some remote location additionally, but I never tried that and would really recommend not to do it. Maybe you should search for a better approach. If you for example use non-ephemeral build agents, the Gradle cache should have the things already and not bother your Nexus, but from what you described, I guess you are using ephemeral build agents. So in that case, it might for example be a strategy to use a read-only cache that you prepare and then map into your ephemeral build agents. For more information on that, have a look at https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:ephemeral-ci-cache and the linked pages
j
It sounds like a good idea, and I've been scared off my original idea because it definitely sounds unachievable. Thank you! I shall give it a go
👌 1
This slack community is always very helpful
❤️ 1
a
wow, 300k a day!
What might also help is Build Cache, so Gradle can skip tasks and thus also skip downloading. Do you have that set up?
👍 1
v
(You can use a "raw" Nexus repository as remote build cache in case you did not know 🙂)
j
Yep I setup a remote build cache as one of the first improvements I made, that works very well, but ultimately I guess to determine if it can use a cache entry it still needs to download lots of dependencies so that it can compute classpaths. At least this is the behaviour I witness and to me it makes sense.
v
Yes