Skip to content

Instantly share code, notes, and snippets.

@dspies
Last active November 8, 2016 19:49
Adding maven-publish plugin to build.gradle
apply plugin:"maven-publish"
// Other closure blocks
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
credentials {
username NEXUS_USERNAME
password NEXUS_PASSWORD
}
url "https://[my.nexus.repo]/repository/releases/"
}
}
}
@dspies
Copy link
Author

dspies commented Nov 8, 2016

NEXUS_USERNAME and NEXUS_PASSWORD are command line parameters for the gradle task. You might use it in a build server like:

./gradlew -PNEXUS_USERNAME=[your_username] -PNEXUS_PASSWORD=[your_password] publish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment