-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
73 lines (59 loc) · 2.18 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
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html
*/
// Plugins
apply plugin: 'java'
// Repositorios
repositories {
jcenter()
}
// Tarefas
// Configura conteiner de banco de dados
task configurarBd(type: Exec) {
commandLine 'docker-compose', 'up', '-d'
}
// Gera arquivo jar da aplicacao Web
jar {
manifest {
attributes "Main-Class": "org.jboss.weld.environment.se.StartMain"
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
// Executa aplicacao Web
task ligarGps(dependsOn:jar) {
doLast {
javaexec { main="-jar"; args jar.archivePath }
}
}
// Ordem de execucao das tarefas
clean.dependsOn configurarBd
clean.mustRunAfter configurarBd
jar.dependsOn clean
jar.mustRunAfter clean
// Dependencias
dependencies {
// Web
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
compile 'com.sparkjava:spark-core:2.3'
// Injecao de dependencia em Java SE
compile group: 'org.jboss.weld.se', name: 'weld-se-shaded', version: '3.0.0.Final'
// Persistencia
compile group: 'org.hibernate', name: 'hibernate-core', version: '5.2.12.Final'
compile group: 'org.postgresql', name: 'postgresql', version: '42.1.4'
// Validacao de beans
compile group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
compile group: 'org.hibernate', name: 'hibernate-validator', version: '6.0.1.Final'
compile group: 'org.hibernate', name: 'hibernate-validator-annotation-processor', version: '6.0.1.Final'
compile group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
compile group: 'org.glassfish', name: 'javax.el', version: '3.0.0'
// Testes automatizados
testCompile 'junit:junit:4.12'
testCompile group: 'io.rest-assured', name: 'rest-assured', version: '3.0.0'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
}