If I run gradlew clean build and I put nexusUser and nexusPassword on gradle.properties it will fail with 401 but the properties are there because if I do println(nexusUser) I get a response. If I hard code the credentials it does work. Gradle 4.3.1
What were you expecting Gradle to do differently here? The values are loaded from gradle.properties using the core properties support in the Java platform. It should only work when following the specifications of a Java properties file.