Closed t-kulmburg closed 1 year ago
there are multiple take on this:
applyToProject
to false and manually add the projects on each projectso far I did not have the time and/or need to implement this see https://github.com/aepfli/gradle-gitlab-repositories/issues/3
content filtering would be anyway the approach, because people could upload packages with the same group to anykind of other repository executed first. so ideally you want to first check for internal ones, and then check on the public ones. Yes mavencentral is quiet good and secure, but specially for company internal things, you want to first check on your repos.
if you want to take a shot at this let me know, I can support you and will be happy to guide you.
applyToProject=false
looks like the way for us
Me and @t-kulmburg somehow both overlooked this when looking at the code.
Filtering would be a cool feature, but at the moment we simply exclude known internal dependencies from the public repositories, so no need for that for us at the moment.
Thx for your quick reply
Take a look at the comment in #3 that allows even easy and fast filtering ;)
hi,
when applying the plugin in
settings.gradle
, theapplyProjects
method automatically adds the GitLab repo to all projects viagradle.beforeProject
and furtherproject.repositories.maven
.This can be convenient, but also means that when entering the
repositories
block inbuild.gradle
and adding more repos likemavenCentral
, they are behind the GitLab repo in the repositories list. As Gradle checks repositories for dependencies in the order the repos are added, it will search for all dependencies in the added GitLab repo before looking them up in the central maven repo.Since only a small part of our dependencies are actually in the private repo, it would be better to check mavenCentral beforehand.
An idea would be adding the possibillity to choose if the GitLab repo should be added to all projecs by only applying the plugin, as it happens now. If preferred not to, the repo can still be added to a project via
maven gitLab.group('123456') { name = "gitlabgroup" }
in therepositories
block in thebuild.gradle
. This would allow us to sort the repositories in the way we would like them to be checked.My current workaround for this is adding the following code block to the
settings.gradle
file, to add one or more repos before the plugin is applied.