Visit my.sonatype.com for documentation on Nexus Repository version 2.
Easy. Here's an example of a build.gradle file that configures a build to publish artifacts to a snapshot repository. As you can see, the publish URL, credentials, and artifact identifiers for this project are all contained in the uploadArchives configuration section.
apply plugin: 'java' apply plugin: 'maven' repositories { maven { url "http://localhost:8081/nexus/content/groups/public" } } dependencies { testCompile "junit:junit:3.8.1" compile "org.jbundle.util:org.jbundle.util.jbackup:2.0.0" compile "net.sf.webtestfixtures:webtestfixtures:2.0.1.3" } uploadArchives { repositories { mavenDeployer { repository(url: "http://localhost:8081/nexus/content/repositories/snapshots") { authentication(userName: "admin", password: "admin123") } pom.version = "1.0-SNAPSHOT" pom.artifactId = "simple-project" pom.groupId = "com.example" } } }
To upload artifacts from this project, run "gradle upload"