Skip to content

Commit fd92cd6

Browse files
committed
Add maven deployment to gradle build
1 parent d8badc0 commit fd92cd6

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

build.gradle

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
apply plugin: 'checkstyle'
2-
apply plugin: 'java'
32
apply plugin: 'jacoco'
3+
apply plugin: 'java'
4+
apply plugin: 'maven'
5+
apply plugin: 'signing'
46

57
sourceCompatibility = 1.7
68

9+
group = 'com.box'
10+
archivesBaseName = 'box-java-sdk'
11+
version = '0.5.0-SNAPSHOT'
12+
713
repositories {
814
mavenCentral()
915
}
@@ -80,7 +86,7 @@ tasks.withType(Test) {
8086

8187
jacoco {
8288
append = true
83-
destinationFile = file("$buildDir/jacoco/test.exec")
89+
destinationFile = file('$buildDir/jacoco/test.exec')
8490
}
8591
}
8692

@@ -93,3 +99,51 @@ test {
9399
excludeCategories 'com.box.sdk.IntegrationTest'
94100
}
95101
}
102+
103+
signing {
104+
sign configurations.archives
105+
}
106+
107+
uploadArchives {
108+
repositories {
109+
mavenDeployer {
110+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
111+
112+
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
113+
authentication(userName: ossrhUsername, password: ossrhPassword)
114+
}
115+
116+
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
117+
authentication(userName: ossrhUsername, password: ossrhPassword)
118+
}
119+
120+
pom.project {
121+
name 'Box Java SDK'
122+
packaging 'jar'
123+
description 'The Box SDK for Java.'
124+
url 'http://opensource.box.com/box-java-sdk/'
125+
126+
scm {
127+
connection 'scm:git:https://github.com/box/box-java-sdk.git'
128+
developerConnection 'scm:git:https://github.com/box/box-java-sdk.git'
129+
url 'https://github.com/box/box-java-sdk'
130+
}
131+
132+
licenses {
133+
license {
134+
name 'The Apache License, Version 2.0'
135+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
136+
}
137+
}
138+
139+
developers {
140+
developer {
141+
id 'gcurtis'
142+
name 'Greg Curtis'
143+
144+
}
145+
}
146+
}
147+
}
148+
}
149+
}

0 commit comments

Comments
 (0)