Gradle not sending creds

Hey, I want to pull depedencies from an repository (Sonatype Nexus), I configured my repo in the following way:

repositories {
    // Use Maven Central for resolving dependencies.

        maven {
        url = uri("")
        credentials {
            username = "user"
            password = "password"
        authentication {


Despite having this configuration I get an 401 Unauthorized from the Nexus. I triple checked my creds and they are correct. I even intercepted the request and no credentials were present in any form with the block for basic Auth and without it. Is there any plugin I need to install or something to get this working?