forked from moleculer-java/moleculer-spring-boot-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
156 lines (111 loc) · 4.74 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'war'
// --- REPOSITORIES ---
repositories {
mavenCentral()
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
// --- CONFIGURATIONS ---
configurations {
runtime
ecj
}
configurations.all {
// resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
// --- DEPENDENCIES ---
dependencies {
// ================ COMPILATION ================
testImplementation 'junit:junit:4.12'
ecj 'org.eclipse.jdt.core.compiler:ecj:4.4.2'
// ================= MOLECULER =================
// nats (required)
implementation group: 'io.nats', name: 'jnats', version: '2.8.0'
// DataTree core (required)
implementation group: 'com.github.berkesa', name: 'datatree-core', version: '1.1.2'
// Moleculer core (required)
implementation group: 'com.github.berkesa', name: 'moleculer-java', version: '1.2.19'
// Moleculer web (required)
implementation group: 'com.github.berkesa', name: 'moleculer-java-web', version: '1.3.3'
// Moleculer developer console (optional)
implementation group: 'com.github.berkesa', name: 'moleculer-java-repl', version: '1.3.0'
// JMX service (optional)
implementation group: 'com.github.berkesa', name: 'moleculer-java-jmx', version: '1.2.1'
// https://mvnrepository.com/artifact/com.diogonunes/JCDP
implementation group: 'com.diogonunes', name: 'JCDP', version: '3.0.4'
// ================== LOGGING ==================
// http://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
// http://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14
implementation group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.30'
// https://mvnrepository.com/artifact/org.slf4j/log4j-over-slf4j
implementation group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.7.30'
// https://mvnrepository.com/artifact/org.slf4j/jcl-over-slf4j
implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.30'
// ================= MONITORING ================
// --- SIGAR API TO QUERY THE CPU USAGE ---
// https://mvnrepository.com/artifact/org.fusesource/sigar
implementation(group: 'org.fusesource', name: 'sigar', version: '1.6.4') {
exclude group: 'log4j', module: 'log4j'
}
// =============== CDI FRAMEWORK ===============
// --- SPRING DEPENDENCY INJECTION FRAMEWORK ---
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter
implementation(group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.5.0') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'org.springframework', module: 'spring-jcl'
}
// ================ JSON APIS ==================
// --- JACKSON PARSER ---
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.3'
// ========== TEMPLATE ENGINES =============
// --- DATATREE TEMPLATES ---
// https://mvnrepository.com/artifact/com.github.berkesa/datatree-templates
implementation group: 'com.github.berkesa', name: 'datatree-templates', version: '1.1.4'
}
// --- COMPILATION ---
compileJava {
options.fork = true
options.forkOptions.with {
executable = 'java'
jvmArgs = ['-classpath', project.configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-nowarn']
}
}
// --- WINDOWS INSTALLER ---
// Run the 'gradle buildInstaller' command to create a setup.exe from this project.
// The EXE will be created in this directory: {project root}/build/installer/dist/
// Run the 'gradle war' command to create WAR for J2EE Servers (eg. for JBoss or WebLogic).
// The WAR will be created in this directory: {project root}/build/libs/
jar {
baseName = 'moleculer-demo'
version = '1.0.0'
exclude('**/application.yml')
exclude('**/logging-development.properties')
exclude('**/logging-production.properties')
}
task cleanupLibs(type: Delete) {
delete fileTree('build/libs') {
include '**/*.jar'
}
}
task copyLibs(type: Copy) {
dependsOn jar
from configurations.compileClasspath
into 'build/libs'
}
task buildInstaller(type: Exec, group: "build") {
description 'Create a standalone Windows Installer from this project.'
dependsOn cleanupLibs, copyLibs
executable 'installer/setup/ISCC.exe'
args 'installer/moleculer.config.iss'
}
// --- SERVLET / WAR SETTINGS ---
war {
rootSpec.exclude('**/logging-development.properties')
rootSpec.exclude('**/logging-production.properties')
}