Adam Roberts
05/21/2025, 7:06 PMTrevJonez
05/21/2025, 7:18 PMAdam Roberts
05/21/2025, 7:24 PMmaven {
url = uri("<https://gitlab>..../packages/maven")
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value System.getenv("PRIVATE_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
content {
includeGroupByRegex("^***.*")
}
}
but I'm not sure where I add it so everywhere in my project can access it, or how to stop it from being searched for in other repo'sTrevJonez
05/21/2025, 7:26 PMdependencyResolutionManagement block.
something like this
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {
url = uri("<https://gitlab>..../packages/maven")
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value System.getenv("PRIVATE_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
content {
includeGroupByRegex("^***.*")
}
}
}
}Adam Roberts
05/21/2025, 7:42 PMephemient
05/21/2025, 7:50 PMAdam Roberts
05/21/2025, 7:53 PMephemient
05/21/2025, 7:54 PMAdam Roberts
05/21/2025, 8:02 PMimplementation 'my.helper.libraries:xyz:3.2.0'
That should be all I'm needing to do no?Adam Roberts
05/21/2025, 8:08 PMBuild was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'app\build.gradle'That may be related...?
ephemient
05/21/2025, 8:09 PMephemient
05/21/2025, 8:10 PMTrevJonez
05/21/2025, 8:11 PMBuild was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by build file 'app\build.gradle'may need to back off that fail on project flag until you get things all sorted out
Adam Roberts
05/21/2025, 9:21 PMVampire
05/22/2025, 1:50 AMFAIL_ON_PROJECT_REPOS, that means either you set repositories in a project build script, or you apply some plugin that adds a repository, the stacktrace should tell you where it is coming from.
If it is from a plugn, that plugn should have at least an opt-out switch, if not it is following really bad practice and should get a bug reported.
You cannot mix repositories in settings script and build script, it is an either or. With the default, it uses settings if no project repositories are there or project repositories otherwise. If you set this to fail on project repos, you get immediately notified that someone or something is misbehaving. If you have to cope with misbehaving plugins, you can set it to prefer settings repository, then project repos will just emit a warning but otherwise be ignored.Vampire
05/22/2025, 1:52 AM<http://artifacts.tak.gov|artifacts.tak.gov> fix their server to either deliver the content or give a 404, but not a 403, or use repository content filters to control which artifacts are taken from that repository and which are not. Or move it to the last position, so that it is only asked for artifacts not in any other repository. ...