-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (97 loc) · 3.41 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
apply plugin: 'java'
apply plugin: 'war';
//apply plugin: 'glassfish';
apply plugin: 'idea'
project.webAppDirName = 'WebContent'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
ext.mainClass = ''
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
mavenCentral()
// You may define additional repositories, or even remove "mavenCentral()".
// Read more about repositories here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
}
dependencies {
compile 'javax:javaee-api:7.0'
// Jersey
compile 'org.glassfish.jersey.media:jersey-media-multipart:2.22.1'
compile 'org.glassfish.jersey.core:jersey-server:2.22.1'
compile 'org.glassfish.jersey.media:jersey-media-json-jackson:2.22.1'
// Hibernate Validator
compile 'org.hibernate:hibernate-validator:5.2.2.Final'
// Jersey Bean Validation
compile 'org.glassfish.jersey.ext:jersey-bean-validation:2.22.1'
// JDBC Driver
compile 'mysql:mysql-connector-java:5.1.37'
// TODO: Add dependencies here ...
// You can read more about how to add dependency here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
testCompile group: 'junit', name: 'junit', version: '4.10'
testCompile 'org.hamcrest:hamcrest-core:1.3'
testCompile 'org.hamcrest:hamcrest-library:1.3'
// Jersey Test Framework
testCompile 'org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.22.1'
testCompile 'org.glassfish.jersey.test-framework:jersey-test-framework-core:2.22.1'
testCompile 'org.glassfish.jersey.containers:jersey-container-grizzly2-servlet:2.22.1'
testCompile 'org.glassfish:jsonp-jaxrs:1.0'
// Mockito
testCompile 'org.mockito:mockito-all:1.10.19'
// HK2
compile 'org.glassfish.hk2:hk2-api:2.3.0'
}
war {
baseName = 'EventManager'
}
ext {
glassFishHome = 'C:\\glassfish-4.1'
asadmin = glassFishHome + (isWindows() ? '\\bin\\asadmin.bat' : '/bin/asadmin')
domain = 'domain1'
}
def isWindows() {
return System.properties['os.name'].toLowerCase().contains('windows')
}
task startServer(type:Exec) {
doFirst {
commandLine asadmin, 'start-domain', '--debug=true', domain
}
}
task stopServer(type:Exec) {
commandLine asadmin, 'stop-domain', domain
}
task deploy(type:Exec) {
commandLine asadmin, 'deploy', '--force=true', war.archivePath
}