plugins{id'java'id'maven'...}repositories{// For public version
maven{url"${nexusUrl}/repository/maven-public/"}// For snapshot version
maven{url"${nexusUrl}/repository/maven-snapshots/"}// For release version
maven{url"${nexusUrl}/repository/maven-releases/"}...}uploadArchives{repositories{mavenDeployer{repository(url:"${nexusUrl}/repository/maven-releases/"){authentication(userName:nexusUsername,password:nexusPassword)}snapshotRepository(url:"${nexusUrl}/repository/maven-snapshots"){authentication(userName:nexusUsername,password:nexusPassword)}}}}...