-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
111 lines (87 loc) · 3.32 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
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 'jhi.seedstore'
version '1.0.0'
sourceCompatibility = 11
repositories {
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 'org.json:json:20220924'
implementation 'com.google.code.gson:gson:2.10'
implementation 'mysql:mysql-connector-java:8.0.31'
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'
providedCompile 'jakarta.servlet:jakarta.servlet-api:6.0.0'
implementation 'org.glassfish.jersey.containers:jersey-container-servlet:3.1.1'
implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.1'
implementation 'org.glassfish.jersey.media:jersey-media-json-jackson:3.1.1'
implementation 'org.glassfish.jersey.media:jersey-media-multipart:3.1.1'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
}
// Generate a .war file
war {
dependsOn jar
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')
// 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('/')
}
}
// Runs the JOOQ code generation
task codegen (type: JavaExec) {
group = 'Execution'
classpath = sourceSets.main.runtimeClasspath
main = 'org.jooq.codegen.GenerationTool'
args 'jooq.xml'
finalizedBy build
}
// 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}")]
}