Skip to content

Commit 21722f7

Browse files
author
jwatson
committed
Set up gradle tasks to publish to sonatype.
1 parent dc91858 commit 21722f7

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

build.gradle

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,46 @@ buildscript {
55
maven {
66
url "https://plugins.gradle.org/m2/"
77
}
8+
maven {
9+
url 'https://jcenter.bintray.com'
10+
}
811
}
912
dependencies {
1013
classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.8"
14+
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
1115
}
1216
}
1317

14-
1518
plugins {
1619
id 'java'
1720
}
1821
apply plugin: 'com.github.sherter.google-java-format'
22+
apply plugin: 'com.bmuschko.nexus'
23+
24+
repositories {
25+
mavenCentral()
26+
}
27+
28+
project.configurations.configure {
29+
"sonatype"() {
30+
extendsFrom archives
31+
}
32+
}
1933

2034
sourceCompatibility = JavaVersion.VERSION_1_8
2135
targetCompatibility = JavaVersion.VERSION_1_8
2236

2337
dependencies {
24-
// TODO make this provided instead of compile?
2538
implementation 'com.amazonaws:aws-lambda-java-core:1.1.0'
26-
implementation 'com.amazonaws:aws-lambda-java-events:2.2.2' // 2.2.2 is earliest version that has all needed event sources
39+
// 2.2.2 is earliest version that has all needed event sources
2740
implementation 'com.amazonaws:aws-java-sdk-s3:1.11.163'
41+
implementation 'com.amazonaws:aws-lambda-java-events:2.2.2'
2842
implementation 'com.amazonaws:aws-java-sdk-kinesis:1.11.163'
2943
implementation 'com.amazonaws:aws-java-sdk-dynamodb:1.11.163'
3044
implementation 'com.googlecode.json-simple:json-simple:1.1'
31-
implementation('io.opentracing:opentracing-api:0.31.0') { transitive = false }
32-
implementation('io.opentracing:opentracing-util:0.31.0') { transitive = false }
33-
implementation('io.opentracing:opentracing-noop:0.31.0') { transitive = false }
45+
implementation('io.opentracing:opentracing-api:0.31.0')
46+
implementation('io.opentracing:opentracing-util:0.31.0')
47+
implementation('io.opentracing:opentracing-noop:0.31.0')
3448

3549
testImplementation 'junit:junit:4.12'
3650
testImplementation 'io.opentracing:opentracing-mock:0.31.0'
@@ -42,8 +56,18 @@ jar {
4256
}
4357
}
4458

45-
allprojects {
46-
repositories {
47-
mavenCentral()
59+
task uploadSonatype(type: Upload) {
60+
configuration = configurations.sonatype
61+
uploadDescriptor = true
62+
}
63+
64+
nexus {
65+
sign = true
66+
configuration = "sonatype"
67+
}
68+
69+
uploadSonatype.doFirst {
70+
configuration.artifacts.each {
71+
println(project.name + " uploading: " + it)
4872
}
4973
}

gradle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
group = "com.newrelic.opentracing.contrib"
2+
version = '1.0-SNAPSHOT'
3+
4+
5+

settings.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
rootProject.name = 'java-aws-lambda'
2-
3-
include 'java-aws-lambda'
1+
rootProject.name = 'java-aws-lambda'

0 commit comments

Comments
 (0)