-
Notifications
You must be signed in to change notification settings - Fork 3
/
maven-publish.gradle
66 lines (61 loc) · 2.3 KB
/
maven-publish.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
apply plugin: 'maven-publish'
group = 'io.github.data-rocks-team'
version = (project.hasProperty('releaseVersion')
? (project.property('releaseVersion').startsWith('v')
? project.property('releaseVersion').substring(1) : project.property('releaseVersion'))
: 'local') as String
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = "$project.name"
from components.java
pom {
name = 'schemaregistry-junit'
description = ('A library that provides an in-memory instance of Confluent Schema '
+ 'Registry to run your tests against.')
url = 'https://github.com/data-rocks-team/schemaregistry-junit'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/data-rocks-team/schemaregistry-junit/blob/main/LICENSE'
}
}
scm {
connection = 'scm:git:git://github.com/data-rocks-team/schemaregistry-junit.git'
developerConnection = 'scm:git:ssh://github.com/data-rocks-team/schemaregistry-junit.git'
url = 'https://github.com/data-rocks-team/schemaregistry-junit'
}
developers {
developer {
name = 'Francesco Nobilia'
url = 'https://nobilia.dev/'
}
}
}
}
}
repositories {
maven {
name = "OSSRH"
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
// Apply signature only if needed
if (project.hasProperty('signing.gnupg.passphrase')) {
apply plugin: 'signing'
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
}