Last active
November 8, 2016 19:49
Adding maven-publish plugin to build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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