-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmaven.gradle
More file actions
89 lines (77 loc) · 3.26 KB
/
maven.gradle
File metadata and controls
89 lines (77 loc) · 3.26 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
apply plugin: 'maven'
allprojects {
ext."signing.keyId" = System.getenv("mavenSigningKeyId")
ext."signing.secretKeyRingFile" = System.getenv("mavenSigningKeyRingFile")
ext."signing.password" = System.getenv("mavenSigningKeyPassword")
}
configurations {
deployerJars
}
dependencies {
deployerJars "org.kuali.maven.wagons:maven-s3-wagon:1.2.1"
}
def target_maven_repo
if (project.hasProperty('target_maven_repo')) {
target_maven_repo = project.property('target_maven_repo')
}
if (target_maven_repo in ['sonatype', 'sonatype-snapshot']) {
apply plugin: 'signing'
def signingKey = System.getenv("mavenSigningKeyId");
def signingPassword = System.getenv("mavenSigningKeyPassword")
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
useInMemoryPgpKeys(signingKey, signingPassword)
sign configurations.archives
}
}
uploadArchives{
repositories {
mavenDeployer {
if (target_maven_repo == 'sonatype') {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: System.getenv('sonatypeUsername'), password: System.getenv('sonatypePassword'))
}
} else if (target_maven_repo == 'sonatype-snapshot') {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: System.getenv('sonatypeUsername'), password: System.getenv('sonatypePassword'))
}
} else if (target_maven_repo == 's3') {
configuration = configurations.deployerJars
repository(url: 's3://maven.mparticle.com')
} else {
repository(url: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath)
}
pom.project {
version project.version
artifactId project.name
name 'mParticle server-side Java SDK'
description "mParticle SDK for server-side Java environments"
url 'https://github.com/mparticle/mparticle-java-events-sdk'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/license/LICENSE-2.0.txt'
}
}
scm {
url 'https://github.com/mparticle/mparticle-java-events-sdk'
connection 'scm:git:https://github.com/mparticle/mparticle-java-events-sdk'
developerConnection 'scm:git:git@github.com:mparticle/mparticle-java-events-sdk.git'
}
developers {
developer {
id 'mParticle'
name 'mParticle Inc.'
email 'developers@mparticle.com'
}
}
}
}
}
}