-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
176 lines (145 loc) · 5.79 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
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.germinate'
version '4.7.4'
java {
sourceCompatibility = JavaVersion.VERSION_21
}
repositories {
maven {
url 'https://repo.spring.io/plugins-release/'
}
maven {
url 'https://maven.imagej.net/content/repositories/public/'
}
maven {
url 'https://nexus.geomatys.com/repository/geotoolkit/'
}
maven {
url 'https://repo.osgeo.org/repository/release/'
}
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'lib', include: ['*.jar'])
implementation 'commons-cli:commons-cli:1.5.0'
implementation 'commons-io:commons-io:2.11.0'
implementation 'com.drewnoakes:metadata-extractor:2.18.0'
implementation 'org.json:json:20230227'
implementation 'com.google.code.gson:gson:2.10'
implementation 'mysql:mysql-connector-java:8.0.33'
implementation 'org.xerial:sqlite-jdbc:3.44.0.0'
implementation 'cisd:jhdf5:14.12.6'
implementation 'net.coobird:thumbnailator:0.4.18'
// implementation 'com.zaxxer:HikariCP:4.0.3'
implementation 'org.jooq:jooq:3.16.18'
implementation 'org.dhatim:fastexcel-reader:0.14.0'
implementation 'com.drewnoakes:metadata-extractor:2.18.0'
implementation 'xerces:xercesImpl:2.12.2'
implementation 'org.codehaus.castor:castor-core:1.4.1'
implementation ('org.codehaus.castor:castor-xml:1.4.1') {
exclude group: 'org.springframework'
}
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:6.5.7'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'de.poiu.apron:apron:2.1.1'
implementation 'de.ipk-gatersleben:isa4j:1.1.0'
providedCompile 'jakarta.servlet:jakarta.servlet-api:6.0.0'
implementation 'org.glassfish.jersey.containers:jersey-container-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 'javax.media:jai_core:1.1.3'
implementation 'org.geotools:gt-shapefile:27.2'
implementation 'net.logicsquad:nanocaptcha:1.3'
// Disabled Swagger until we can figure out how to make it work with Jersey3 and Jakarta
implementation 'io.swagger.core.v3:swagger-jaxrs2-jakarta:2.2.19'
implementation 'io.swagger.core.v3:swagger-jaxrs2-servlet-initializer-jakarta:2.2.19'
}
// Generate a .jar file for the Germinate importer project
task jarForImporter (type: Jar, dependsOn: classes) {
from sourceSets.main.output
archiveFileName = "germinate-core-${project.version}.jar"
includeEmptyDirs = false
include '**/germinate/resource/**'
include '**/Database.class'
include '**/util/**Utils**'
include '**/util/**/**hdf**/**'
include '**/auth/**UserType**'
include '**/Secured**'
include '**/PermitAll**'
include '**/AuthenticationFilter**'
include '**/**DatasetTableResource**'
include '**/ExportResource**'
include '**/BaseResource**'
include '**/ContextResource**'
include '**/IFilteredResource**'
include '**/PropertyWatcher**'
}
// 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 = "germinate-client-${project.version}.jar"
includeEmptyDirs = false
include '**/germinate/resource/**'
include '**/pojos/**'
include '**/StatusMessage**'
include '**/client/**'
}
// Generate a .war file
war {
dependsOn jar, jarForImporter, jarClient
rootSpec.exclude('**/jhi/**/*.class')
rootSpec.includeEmptyDirs = false
// Include external .jar files, but exclude the Germinate client and core.
classpath fileTree(dir:'build/libs/', include:'*.jar', excludes: ['germinate-client.jar', 'germinate-core.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}")]
}
// Automatically build both jars on every build
rootProject.tasks.getByName('build').dependsOn jarClient
rootProject.tasks.getByName('build').dependsOn jarForImporter