/
build.gradle
162 lines (143 loc) · 4.75 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
import java.text.SimpleDateFormat
plugins {
id 'java-library'
id 'signing'
id 'eclipse'
id 'jacoco'
id 'maven-publish'
id 'com.github.ben-manes.versions' version '0.39.0'
id 'net.nemerosa.versioning' version '2.15.0'
id 'org.owasp.dependencycheck' version '6.3.2'
}
group = 'net.reini'
defaultTasks 'build'
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
configurations {
asciidoclet
}
repositories {
mavenCentral()
}
dependencies {
compileOnly 'jakarta.platform:jakarta.jakartaee-api:8.0.0'
implementation 'org.slf4j:slf4j-api:1.7.32'
implementation 'com.rabbitmq:amqp-client:5.13.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
testImplementation 'jakarta.platform:jakarta.jakartaee-api:8.0.0'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.1'
testImplementation 'org.mockito:mockito-core:4.0.0'
testImplementation 'org.mockito:mockito-junit-jupiter:4.0.0'
testRuntimeOnly 'org.junit.platform:junit-platform-runner:1.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
testRuntimeOnly 'ch.qos.logback:logback-classic:1.2.6'
}
compileJava {
doFirst {
options.compilerArgs = [
'-Xlint:all'
]
}
}
signing {
required { project.hasProperty('signing.password') && !project.version.endsWith('-SNAPSHOT') }
sign publishing.publications
}
jar {
manifest {
attributes 'Implementation-Title': 'RabbitMQ CDI extension',
'Implementation-Version': project.version,
'Build-Date': buildDate,
'Build-Time': buildTime,
'Build-Revision': versioning.info.commit,
'Automatic-Module-Name': "net.reini.rabbitmq.cdi"
metaInf {
from file('.')
include 'LICENSE'
}
}
}
test {
useJUnitPlatform()
testLogging {
events 'skipped'
}
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'pr', 'ea'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-+]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
check.dependsOn jacocoTestReport //, dependencyCheckUpdate
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'RabbitMQ JavaEE/JakartaEE CDI enabler'
description = 'Enables CDI based usage of RabbitMQ within a JavaEE/JakartaEE application.'
url = 'https://github.com/reinhapa/rabbitmq-cdi'
scm {
connection = 'scm:git://github.com/reinhapa/rabbitmq-cdi.git'
developerConnection = 'scm:git://github.com/reinhapa/rabbitmq-cdi.git'
url = 'https://github.com/reinhapa/rabbitmq-cdi'
}
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
distribution = 'repo'
}
}
developers {
developer {
id = 'reinhapa'
name = 'Patrick Reinhart'
email = 'patrick@reini.net'
}
developer {
id = 'ohumbel'
name = 'Otmar Humbel'
email = 'ohumbel@gmail.com'
}
}
}
}
}
repositories {
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
}