forked from platform-team/aws-maven
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
198 lines (159 loc) · 5.3 KB
/
build.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
import java.time.Duration
plugins {
id "java-library"
id "maven-publish"
id 'signing'
id 'jacoco'
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
}
def profile = "snapshot"
if (project.hasProperty('target')) {
profile = "${target}"
}
ext.isReleaseVersion = profile == "release"
group = 'com.github.poad'
version = '7.0.0' + (profile == "snapshot" ? "." + java.time.format.DateTimeFormatter
.ofPattern("yyyyMMddHHmmss")
.format(ZonedDateTime.now()) + '-SNAPSHOT' : '')
description = 'Amazon Web Services S3 Maven Wagon Support'
java.sourceCompatibility = JavaVersion.VERSION_1_8
java {
withSourcesJar()
withJavadocJar()
}
ext {
slf4jVersion = '2.0.16'
xmlBindVersion = '4.0.5'
}
repositories {
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
dependencies {
// https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-bom
implementation(platform('com.amazonaws:aws-java-sdk-bom:1.12.780'))
testImplementation(platform("org.junit:junit-bom:5.11.4"))
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-bom
implementation(platform("org.apache.logging.log4j:log4j-bom:2.24.3"))
implementation 'com.amazonaws:aws-java-sdk-s3'
implementation "org.slf4j:jcl-over-slf4j:${slf4jVersion}"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
implementation 'org.apache.commons:commons-lang3:3.17.0'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation "com.sun.xml.bind:jaxb-core:${xmlBindVersion}"
implementation "com.sun.xml.bind:jaxb-impl:${xmlBindVersion}"
implementation 'javax.activation:javax.activation-api:1.2.0'
implementation 'org.apache.maven.wagon:wagon-provider-api:3.5.3'
testImplementation 'pl.pragmatists:JUnitParams:1.1.1'
testImplementation 'org.mockito:mockito-core:5.15.2'
testImplementation 'org.hamcrest:hamcrest:3.0'
testImplementation("org.junit.jupiter:junit-jupiter") {
because 'allows to write and run Jupiter tests'
}
testImplementation("junit:junit:4.13.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine") {
because 'allows JUnit 3 and JUnit 4 tests to run'
}
testRuntimeOnly("org.junit.platform:junit-platform-launcher") {
because 'allows tests to run from IDEs that bundle older version of launcher'
}
runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
}
signing {
required { isReleaseVersion }
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
}
nexusPublishing {
repositories {
sonatype ()
}
}
publishing {
publications {
release(MavenPublication) {
from components.java
pom {
name = "Amazon Web Services S3 Maven Wagon Support"
description = "Standard Maven wagon support for s3:// urls"
url = "https://github.com/poad/aws-maven"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}
developers {
developer {
id = "poad"
name = "Kenji Saito"
email = "poad1010@gmail.com"
}
}
scm {
connection = "scm:git:git@github.com:poad/aws-maven.git"
url = "https://github.com/poad/aws-maven"
}
inceptionYear = "2019"
ciManagement {
system = "Github"
url = "https://github.com/poad/aws-maven/"
}
issueManagement {
system = "Github"
url = "https://github.com/poad/aws-maven/issues"
}
}
}
}
repositories {
maven {
name "OSSRH"
url profile != "snapshot" ? "https://oss.sonatype.org/service/local/staging/deploy/maven2/" : "https://oss.sonatype.org/content/repositories/snapshots/"
if (hasProperty('sonatypeUsername') && hasProperty('sonatypePassword')) {
credentials {
username = "${sonatypeUsername}"
password = "${sonatypePassword}"
}
}
}
}
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
test {
useJUnitPlatform {
includeEngines 'junit-jupiter', 'junit-vintage'
excludeEngines 'custom-engine'
// includeTags 'fast'
excludeTags 'slow'
}
testLogging {
events 'passed', 'skipped', 'failed'
exceptionFormat "full"
}
reports {
junitXml.required = true
html.required = true
}
finalizedBy(jacocoTestReport)
}
jacocoTestReport {
reports {
xml.required = true
html.required = true
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}