Skip to content

Instantly share code, notes, and snippets.

@tslmy
Created September 16, 2022 19:01
Show Gist options
  • Save tslmy/ec271a12f78722443207774582b52109 to your computer and use it in GitHub Desktop.
Save tslmy/ec271a12f78722443207774582b52109 to your computer and use it in GitHub Desktop.
Defining your own Maven Repository server: Gradle
publishing {
publications {
// Defines a publication that sends the compiled Java component to Maven.
maven(MavenPublication) { from(components.java) }
}
repositories {
maven {
def type = version.endsWith('SNAPSHOT') ? 'snapshots' : 'releases'
name = "repo-for-${type}"
url = "https://example.com/repositories/${type}/"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment