-
Notifications
You must be signed in to change notification settings - Fork 29
/
build.gradle
110 lines (92 loc) · 3.29 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 org.gradle.plugins.ide.eclipse.model.Facet
import org.gradle.plugins.ide.eclipse.model.SourceFolder
import org.akhikhl.gretty.TomcatStartTask
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.akhikhl.gretty:gretty:+'
}
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.akhikhl.gretty'
sourceCompatibility = 1.7
targetCompatibility = 1.7
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
webAppDirName = 'WebRoot'
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}
gretty {
servletContainer = 'tomcat8'
httpPort = 9080
scanInterval = 30
managedClassReload = true
}
repositories {
mavenCentral()
}
configurations {
all*.exclude module: 'commons-logging'
all*.exclude module: 'log4j'
}
dependencies {
compile 'org.springframework:spring-context:4.2.6.RELEASE'
compile 'org.springframework:spring-web:4.2.6.RELEASE'
compile 'org.springframework:spring-jdbc:4.2.6.RELEASE'
compile 'org.springframework:spring-orm:4.2.6.RELEASE'
compile 'org.springframework:spring-test:4.2.6.RELEASE'
compile 'org.hibernate:hibernate-core:4.3.11.Final'
compile('org.apache.struts:struts2-core:2.3.28.1') {
exclude module:'javassist'
}
compile('org.apache.struts:struts2-spring-plugin:2.3.28.1') {
exclude module:'javassist'
}
compile 'mysql:mysql-connector-java:5.1.38'
compile 'org.slf4j:slf4j-api:1.7.12'
compile 'ch.qos.logback:logback-core:1.1.3'
compile 'ch.qos.logback:logback-classic:1.1.3'
compile 'org.slf4j:log4j-over-slf4j:1.7.12'
compile 'org.slf4j:jcl-over-slf4j:1.7.12'
testCompile 'junit:junit:4.12'
}
eclipse {
// do NOT work, puzzling me
classpath {
defaultOutputDir = file('bin')
file {
beforeMerged { classpath ->
classpath.entries.clear()
}
whenMerged { cp ->
cp.entries.findAll { it instanceof SourceFolder && it.path.startsWith("src/main/") }*.output = "bin/main"
cp.entries.findAll { it instanceof SourceFolder && it.path.startsWith("src/test/") }*.output = "bin/test"
cp.entries.removeAll { it.kind == "output" }
}
/*withXml { n ->
def cpEntry = n.asNode().classpathentry
cpEntry.findAll { it.@path.startsWith('src/main') }.each { it.@output = 'bin/main' }
cpEntry.findAll { it.@path.startsWith('src/test') }.each { it.@output = 'bin/test' }
}*/
}
}
wtp {
facet {
facet name: 'java', type: Facet.FacetType.fixed
facet name: 'jst.web', type: Facet.FacetType.fixed
facet name: 'wst.jsdt.web', type: Facet.FacetType.fixed
facet name: 'java', version: '1.7'
facet name: 'jst.web', version: '3.0'
facet name: 'wst.jsdt.web', version: '1.0'
file.withXml { provider ->
provider.asNode().fixed.find { it.@facet == 'jst.java' }.@facet = 'jst2.java'
}
}
}
}