forked from germinateplatform/gatekeeper-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
127 lines (102 loc) · 3.9 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
import com.bmuschko.gradle.cargo.convention.Deployable
import com.bmuschko.gradle.cargo.tasks.remote.CargoRedeployRemote
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.bmuschko:gradle-cargo-plugin:2.9.0'
}
}
plugins {
id 'java'
id 'war'
}
apply plugin: 'com.bmuschko.cargo-base'
compileJava.options.encoding = 'UTF-8'
group 'uk.ac.hutton.gatekeeper'
version '4.7.1'
sourceCompatibility = JavaVersion.VERSION_21
repositories {
mavenCentral()
maven {
url 'https://repo.spring.io/plugins-release/'
}
maven {
url 'https://maven.imagej.net/content/repositories/public/'
}
}
dependencies {
implementation fileTree(dir: 'lib', include: ['*.jar'])
implementation 'commons-io:commons-io:2.11.0'
providedCompile 'jakarta.servlet:jakarta.servlet-api:6.0.0'
implementation 'org.glassfish.jersey.containers:jersey-container-grizzly2-servlet:3.1.3'
implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.3'
implementation 'org.glassfish.jersey.media:jersey-media-multipart:3.1.3'
implementation 'org.glassfish.jersey.media:jersey-media-json-jackson:3.1.3'
implementation 'org.json:json:20220924'
implementation 'mysql:mysql-connector-java:8.0.28'
implementation 'org.jooq:jooq:3.16.18'
implementation 'org.jooq:jooq-codegen:3.16.18'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'javax.activation:activation:1.1.1'
implementation 'org.glassfish.jaxb:jaxb-runtime:4.0.2'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
implementation 'org.flywaydb:flyway-core:4.0.2'
implementation 'com.sun.mail:smtp:2.0.1'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
}
// Generate a .jar file that other applications can use to communicate with the API
task jarClient (type: Jar, dependsOn: classes) {
from sourceSets.main.output
archiveFileName = 'gatekeeper-client.jar'
includeEmptyDirs = false
include '**/gatekeeper/resource/**'
include '**/pojos/**'
include '**/StatusMessage**'
include '**/client/**'
}
// Runs the JOOQ code generation
task codegen (type: JavaExec) {
group = 'Execution'
classpath = sourceSets.main.runtimeClasspath
main = 'org.jooq.codegen.GenerationTool'
args 'jooq.xml'
}
// Generate a .war file
war {
dependsOn jar, jarClient
rootSpec.exclude('**/jhi/**/*.class')
rootSpec.includeEmptyDirs = false
// Include external .jar files, but exclude the Gatekeeper client.
classpath fileTree(dir:'build/libs/', include:'*.jar', excludes: ['gatekeeper-client.jar'])
// Set the classpath
manifest {
attributes('Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' '))
}
webInf {
// Include the .properties file into the classes folder
from(project.projectDir.toString()) {
include 'config.properties'
include 'logging.properties'
into('classes')
}
}
// Include the client code if it's available
from("${project.projectDir.toString()}/client") {
include '**/**.*'
into('/')
}
}
// Deploy the created .war file to Tomcat
task deployTomcat (type: CargoRedeployRemote) {
dependsOn = [war]
containerId = project.findProperty('tomcat.manager.version') ?: "tomcat10x"
protocol = project.findProperty('tomcat.manager.protocol') ?: "http"
hostname = project.findProperty('tomcat.manager.hostname') ?: "localhost"
port = (project.findProperty('tomcat.manager.port') ?: "8080") as Integer
username = project.findProperty('tomcat.manager.username') ?: ""
password = project.findProperty('tomcat.manager.password') ?: ""
deployables = [new Deployable(files: project.files([war.archiveFile]), context: "${project.'project.name'}/v${project.version}")]
}