@@ -7,10 +7,12 @@ plugins {
7
7
`java`
8
8
`java- library`
9
9
`maven- publish`
10
+ `signing`
11
+ id(" io.github.gradle-nexus.publish-plugin" ) version " 1.3.0"
10
12
}
11
13
12
14
group = " software.amazon.cryptography"
13
- version = " 1.0-SNAPSHOT "
15
+ version = " 3.0.0-preview-1 "
14
16
description = " Aws Database Encryption Sdk for DynamoDb Java"
15
17
16
18
java {
@@ -68,7 +70,7 @@ val dynamodb by configurations.creating
68
70
dependencies {
69
71
implementation(" org.dafny:DafnyRuntime:4.1.0" )
70
72
implementation(" software.amazon.smithy.dafny:conversion:0.1" )
71
- implementation(" software.amazon.cryptography:AwsCryptographicMaterialProviders :1.0-SNAPSHOT " )
73
+ implementation(" software.amazon.cryptography:aws-cryptographic-material-providers :1.0.0-preview-1 " )
72
74
73
75
implementation(platform(" software.amazon.awssdk:bom:2.19.1" ))
74
76
implementation(" software.amazon.awssdk:dynamodb" )
@@ -107,12 +109,55 @@ dependencies {
107
109
}
108
110
109
111
publishing {
112
+ publications.create<MavenPublication >(" mavenLocal" ) {
113
+ groupId = " software.amazon.cryptography"
114
+ artifactId = " aws-database-encryption-sdk-dynamodb"
115
+ from(components[" java" ])
116
+ }
117
+
110
118
publications.create<MavenPublication >(" maven" ) {
111
119
groupId = " software.amazon.cryptography"
112
120
artifactId = " aws-database-encryption-sdk-dynamodb"
113
121
from(components[" java" ])
122
+
123
+ // Include extra information in the POMs.
124
+ afterEvaluate {
125
+ pom {
126
+ name.set(" AWS Database Encryption SDK for DynamoDB" )
127
+ description.set(" AWS Database Encryption SDK for DynamoDB in Java" )
128
+ url.set(" https://github.com/aws/aws-database-encryption-sdk-dynamodb-java" )
129
+ licenses {
130
+ license {
131
+ name.set(" Apache License 2.0" )
132
+ url.set(" http://www.apache.org/licenses/LICENSE-2.0.txt" )
133
+ distribution.set(" repo" )
134
+ }
135
+ }
136
+ developers {
137
+ developer {
138
+ id.set(" amazonwebservices" )
139
+ organization.set(" Amazon Web Services" )
140
+ organizationUrl.set(" https://aws.amazon.com" )
141
+ roles.add(" developer" )
142
+ }
143
+ }
144
+ scm {
145
+ url.set(" https://github.com/aws/aws-database-encryption-sdk-dynamodb-java.git" )
146
+ }
147
+ }
148
+ }
149
+ }
150
+ repositories {
151
+ mavenLocal()
152
+ maven {
153
+ name = " StagingCodeArtifact"
154
+ url = URI .create(" https://crypto-tools-internal-587316601012.d.codeartifact.us-east-1.amazonaws.com/maven/java-dbesdk-ddb-staging/" )
155
+ credentials {
156
+ username = " aws"
157
+ password = System .getenv(" CODEARTIFACT_TOKEN" )
158
+ }
159
+ }
114
160
}
115
- repositories { mavenLocal() }
116
161
}
117
162
118
163
tasks.withType<JavaCompile >() {
@@ -185,3 +230,36 @@ tasks.javadoc {
185
230
}
186
231
exclude(" src/main/dafny-generated" )
187
232
}
233
+
234
+ nexusPublishing {
235
+ // We are using the nexusPublishing plugin since it is recommended by Sonatype Gradle Project configurations
236
+ // and it is easy to supply the creds we need to deploy
237
+ // https://github.com/gradle-nexus/publish-plugin/
238
+ repositories {
239
+ sonatype {
240
+ nexusUrl.set(uri(" https://aws.oss.sonatype.org/service/local/" ))
241
+ snapshotRepositoryUrl.set(uri(" https://aws.oss.sonatype.org/content/repositories/snapshots/" ))
242
+ username.set(System .getenv(" SONA_USERNAME" ))
243
+ password.set(System .getenv(" SONA_PASSWORD" ))
244
+ }
245
+ }
246
+ }
247
+
248
+ signing {
249
+ useGpgCmd()
250
+
251
+ // Dynamically set these properties
252
+ project.ext.set(" signing.gnupg.executable" , " gpg" )
253
+ project.ext.set(" signing.gnupg.useLegacyGpg" , " true" )
254
+ project.ext.set(" signing.gnupg.homeDir" , System .getenv(" HOME" ) + " /.gnupg/" )
255
+ project.ext.set(" signing.gnupg.optionsFile" , System .getenv(" HOME" ) + " /.gnupg/gpg.conf" )
256
+ project.ext.set(" signing.gnupg.keyName" , System .getenv(" GPG_KEY" ))
257
+ project.ext.set(" signing.gnupg.passphrase" , System .getenv(" GPG_PASS" ))
258
+
259
+ // Signing is required if building a release version and if we're going to publish it.
260
+ // Otherwise if doing a maven publication we will sign
261
+ setRequired({
262
+ gradle.getTaskGraph().hasTask(" publish" )
263
+ })
264
+ sign(publishing.publications[" maven" ])
265
+ }
0 commit comments