-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
127 lines (107 loc) · 5.48 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
buildscript {
dependencies {
classpath group: 'org.codehaus.groovy', name: 'groovy-xml', version: '2.5.6' // for creating xml (MarkupBuilder) needs only for task 'generateJooq'
classpath group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0' // jax-b needs only for task 'generateJooq'
classpath group: 'javax.activation', name: 'activation', version:'1.1' // jax-b needs only for task 'generateJooq'
classpath group: 'org.glassfish.jaxb', name: 'jaxb-runtime' , version:'2.3.0' // jax-b needs only for task 'generateJooq'
classpath group: 'com.h2database', name: 'h2', version: '1.3.148' // needs only for task 'generateJooq'
classpath group: 'org.jooq', name: 'jooq-codegen', version: '3.11.0' // needs only for task 'generateJooq'
}
}
plugins {
id 'java'
id 'application'
}
repositories {
jcenter()
}
dependencies {
testImplementation 'junit:junit:4.12'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2'
compile group: 'com.h2database', name: 'h2', version: '1.3.148'
// -------------------------------------- Embedded Jetty+Jersey start ----------------------------------------------
// dependency exists in 'spark-core' compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.15.v20190215' // for org.eclipse.jetty.servlet.ServletContextHandler
compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-servlet-core', version: '2.28' // for org.glassfish.jersey.servlet.ServletContainer
compile group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: '2.28' // InjectionManagerFactory not found.
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1' // for unmarshalling json/xml ClassNotFoundException: javax.xml.bind.Unmarshaller
compile group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: '2.28' // for MediaType.APPLICATION_JSON MessageBodyWriter not found for media type=application/json for parsing response
// -------------------------------------- Embedded Jetty+Jersey end ------------------------------------------------
compile group: 'com.sparkjava', name: 'spark-core', version:'2.7.2' // spark
compile group: 'ma.glasnost.orika', name: 'orika-core', version: '1.5.4' // for mapping entity to dto
compile group: 'commons-dbutils', name: 'commons-dbutils', version: '1.7' // for open/close db connection etc.
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.7'// for testing REST by httpClient
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5' // for json serialization
compile group: 'org.jooq', name: 'jooq', version: '3.11.0'
compile group: 'org.codehaus.groovy', name: 'groovy-xml', version: '2.5.6' // for creating xml (MarkupBuilder) needs only for JooqGenerator
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0' // jax-b needs only for JooqGenerator
compile group: 'javax.activation', name: 'activation', version:'1.1' // jax-b needs only for JooqGenerator
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime' , version:'2.3.0' // jax-b needs only JooqGenerator
compile group: 'org.jooq', name: 'jooq-codegen', version: '3.11.0' // needs only for JooqGenerator
compile group: 'com.google.inject', name: 'guice', version: '4.2.2' // DI (dependency injection)
compile group: 'org.apache.commons', name: 'commons-dbcp2', version: '2.6.0' // for BasicDataSource
}
apply plugin: 'java'
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceSets {
main {
java {
srcDirs= ["src/main/java"]
}
resources {
srcDirs= ["src/main/resources"]
}
}
test {
java {
srcDirs= ["src/test/java"]
}
resources {
srcDirs= ["src/test/resources"]
}
}
}
mainClassName = 'com.tsoyolv.transfermoney.Application'
apply plugin:'application'
/**
* Use it after scripts migration
*/
class JooqGenerateTask extends DefaultTask {
@TaskAction
def generate() {
def xml = new StringWriter()
new groovy.xml.MarkupBuilder(xml)
.configuration('xmlns': 'http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd') {
jdbc() {
driver('org.h2.Driver')
url('jdbc:h2:mem:transfermoney;DB_CLOSE_DELAY=-1')
user('sa')
password('sa')
}
generator() {
database() {
inputSchema('PUBLIC')
includes('.*')
excludes()
}
// Watch out for this caveat when using MarkupBuilder with "reserved names"
// - https://github.com/jOOQ/jOOQ/issues/4797
// - http://stackoverflow.com/a/11389034/521799
// - https://groups.google.com/forum/#!topic/jooq-user/wi4S9rRxk4A
generate([:]) {
pojos true
daos true
}
target() {
packageName('com.tsoyolv.transfermoney.generated.jooq')
directory('src/main/java')
}
}
}
org.jooq.codegen.GenerationTool.generate(xml.toString())
println xml.toString()
}
}
// Create a task using the task type
task jooqGenerate(type: JooqGenerateTask)