I want to use a private Maven repo with `exclusive...
# community-support
d
I want to use a private Maven repo with
exclusiveContent
for a group but only if the version doesn't end in " `-SNAPSHOT`". This is because: 1. I need to prevent requests for my company's private artefacts going to public maven repos and I've got a number of repos which makes `include`/`exclude` a bit tedious. 2. The reason for excluding
-SNAPSHOT
is that my team still likes to use maven local 😭 so they don't want the requests for private SNAPSHOT artefacts to go through to the server. I've tried a number of things like:
Copy code
exclusiveContent {
    forRepository {
        // My special repository for the company com.example
    }
    filter {
        includeVersionByRegex("com.example.*", ".*", "^(?!.*-SNAPSHOT\$)")
    }
}
but I can't seem to get the result I want. I'm guessing that what I am trying to do is impossible using the
exclusiveContent
API. Would that be right? Links: https://docs.gradle.org/current/userguide/filtering_repository_content.html
v
I didn't play much with exclusive content yet, but from gut feeling I'd say your try looks fine. How does it behave with that?
👀 1