-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
226 lines (199 loc) · 7.72 KB
/
build.gradle
File metadata and controls
226 lines (199 loc) · 7.72 KB
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
buildscript {
repositories {
mavenCentral()
maven {
url = 'https://repo.grails.org/grails/restricted'
}
}
dependencies { // Not Published to Gradle Plugin Portal
classpath platform("org.apache.grails:grails-bom:$grailsVersion")
classpath "org.apache.grails:grails-data-hibernate5"
classpath "org.apache.grails:grails-gradle-plugins"
}
}
plugins {
id "war"
id "idea"
id "java-library"
id 'maven-publish'
id 'signing'
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
}
// Not Published to Gradle Plugin Portal
apply plugin: "org.apache.grails.gradle.grails-plugin"
version = xhReleaseVersion
group = 'io.xh'
repositories {
mavenCentral()
maven {
url = 'https://repo.grails.org/grails/restricted'
}
}
dependencies {
constraints {
api("org.apache.mina:mina-core:2.2.4") {
because "CVE-2024-52046 - deserialization vulnerability in < 2.2.4"
}
}
//-------------------------------------------------------
// Grails 7.0 REST Plugin Defaults + Other Grails Plugins
//-------------------------------------------------------
profile "org.apache.grails.profiles:plugin"
developmentOnly "org.springframework.boot:spring-boot-devtools"
api platform("org.apache.grails:grails-bom:$grailsVersion")
api "org.apache.grails:grails-async"
api "org.apache.grails:grails-core"
api "org.apache.grails:grails-data-hibernate5"
api "org.apache.grails:grails-databinding"
api "org.apache.grails:grails-events"
api "org.apache.grails:grails-gsp"
api "org.apache.grails:grails-interceptors"
api "org.apache.grails:grails-logging"
api "org.apache.grails:grails-services"
api "org.apache.grails:grails-url-mappings"
api "org.apache.grails:grails-web-boot"
api "org.springframework.boot:spring-boot-autoconfigure"
api "org.springframework.boot:spring-boot-starter-logging"
api "org.springframework.boot:spring-boot-starter-tomcat"
api "org.springframework.boot:spring-boot-starter-validation"
api "org.springframework.boot:spring-boot-starter-actuator"
api "org.grails.plugins:grails-mail:5.0.3"
api "org.apache.grails:grails-quartz:4.0.0"
//--------------------
// Hoist Additions
//--------------------
api "com.hazelcast:hazelcast"
api "org.apache.tomcat:tomcat-jdbc"
api "org.apache.groovy:groovy-dateutil"
api "org.hibernate:hibernate-jcache:5.6.15.Final", {
exclude group: 'org.hibernate', module: 'hibernate-core'
}
api "com.esotericsoftware:kryo:5.6.2"
api "com.github.java-json-tools:json-patch:1.13"
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
api "com.jayway.jsonpath:json-path:2.9.0"
api "commons-io:commons-io:2.21.0"
api "org.apache.directory.api:api-all:2.1.7"
api "org.apache.httpcomponents.client5:httpclient5:5.5"
api "org.apache.poi:poi-ooxml-full:5.5.1"
api "org.apache.poi:poi-ooxml:5.5.1"
api "org.apache.poi:poi:5.5.1"
api "org.jasypt:jasypt:1.9.3"
api "org.owasp.encoder:encoder:1.3.1"
api "org.springframework:spring-websocket"
api "io.micrometer:micrometer-registry-prometheus"
api "io.micrometer:micrometer-registry-otlp"
api platform("io.opentelemetry:opentelemetry-bom:1.49.0")
api "io.opentelemetry:opentelemetry-sdk"
api "io.opentelemetry:opentelemetry-exporter-otlp"
api "io.opentelemetry:opentelemetry-exporter-common"
api "io.opentelemetry:opentelemetry-context"
// Workaround needed by micrometer-registry-otlp at compile time
api "io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha"
// Workaround needed by opentelemetry exporter
api "io.opentelemetry:opentelemetry-exporter-sender-okhttp"
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Dspring.output.ansi.enabled=always']
}
}
bootJar.enabled = false
tasks.bootRun.doFirst {
throw new RuntimeException('The bootRun task is not supported in hoist-core. If running in a "wrapper" config, ensure you run the task from your app, not the top-level wrapper.')
}
//--------------------
// JDK
//-------------------
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile) {
options.release = 17
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
//------------------------
// Maven Central publishing
// This was written using the "How to Publish a Grails Plugin to the Maven Central Repository" guide
// https://grails.apache.org/blog/2021-04-07-publish-grails-plugin-to-maven-central.html
// See also "A sample Grails plugin configured to publish to Maven Central"
// https://github.com/puneetbehl/myplugin/blob/main/build.gradle
//------------------------
publishing {
publications {
hoistCore(MavenPublication) {
groupId = 'io.xh'
artifactId = 'hoist-core'
version = xhReleaseVersion
from components.java
pom {
name = 'hoist-core'
description = "Extremely Heavy Industry's toolkit for enterprise web applications."
url = 'https://xh.io'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
organization {
name = 'Extremely Heavy Industries'
url = 'https://xh.io'
}
scm {
url = "https://github.com/xh/hoist-core"
connection = "scm:git@github.com:xh/hoist-core.git"
developerConnection = "scm:git@github.com:xh/hoist-core.git"
}
issueManagement {
system = "GitHub"
url = "https://github.com/xh/hoist-core/issues"
}
developers {
developer {
id = 'xh'
name = 'Extremely Heavy Industries'
email = 'info@xh.io'
}
}
}
def groovyOutputDir = sourceSets.main.output.classesDirs.files.find { it.path.contains('/groovy/') }
artifact source: "${groovyOutputDir}/META-INF/grails-plugin.xml",
classifier: 'plugin',
extension: 'xml'
}
}
}
// Signing artifacts
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
def signingKey = findProperty("signingKey") ?: System.getenv("SIGNING_KEY")
def signingPassword = findProperty("signingPassword") ?: System.getenv("SIGNING_PASSWORD")
if (signingKey) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
sign publishing.publications.hoistCore
}
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
nexusPublishing {
repositories {
sonatype {
// see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration
nexusUrl = uri "https://ossrh-staging-api.central.sonatype.com/service/local/"
snapshotRepositoryUrl = uri "https://central.sonatype.com/repository/maven-snapshots/"
username = project.hasProperty('sonatypeUsername') ? project.getProperty('sonatypeUsername') : System.getenv('SONATYPE_USERNAME')
password = project.hasProperty('sonatypePassword') ? project.getProperty('sonatypePassword') : System.getenv('SONATYPE_PASSWORD')
}
}
}