Nexus Repository 2 officially sunsetted June 30, 2025. Visit my.sonatype.com for archived documentation. Migrate to Sonatype Nexus Repository 3 as soon as possible.
Check out the example project at https://github.com/sonatype/nexus-book-examples/tree/master/gradle/simple-project-staging.