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.
    mavenCentral()

        maven {
        url = uri("https://nexus.mycompany.com/repository/maven-snapshots/")
        credentials {
            username = "user"
            password = "password"
        }
        authentication {
            create<BasicAuthentication>("basic")
        }
    }

}

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?