-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
82 lines (74 loc) · 2.14 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
version = '1.0'
def v = [
spring: '3.1.4.RELEASE',
slf4j: '1.7.5',
logback: '1.0.13'
]
subprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java'
repositories {
mavenCentral()
}
idea {
module {
downloadSources = true
}
}
}
project(':zipExample') {
dependencies {
compile project(':zipStarter')
}
task myjar(type: Jar) {
into('/') {
from project(':zipStarter').sourceSets.main.output
}
into('classes') {
from sourceSets.main.output
}
destinationDir = file("$buildDir/libs")
archiveName = 'zipExample.zip'
manifest {
attributes 'Main-Class': 'boot.ZipStarter'
attributes 'ZipStarter-Class-Path': 'classes'
attributes 'ZipStarter-Main-Class': 'com.sahlbach.zipstarter.zip.HelloWorld'
}
doLast {
println "Try this: java -jar zipExample/build/libs/zipExample.zip"
}
}
jar {
actions = []
dependsOn myjar
}
}
project(':warExample') {
apply plugin: 'jetty'
dependencies {
compile("org.springframework:spring-webmvc:$v.spring")
compile("ch.qos.logback:logback-classic:$v.logback")
runtime("org.slf4j:slf4j-api:$v.slf4j",
"org.slf4j:jcl-over-slf4j:$v.slf4j")
providedCompile project(':zipStarter')
}
configurations {
all*.exclude group: "commons-logging", module: "commons-logging"
}
war {
manifest {
attributes 'Main-Class': 'boot.ZipStarter'
attributes 'ZipStarter-Class-Path': 'WEB-INF/classes WEB-INF/lib'
attributes 'ZipStarter-Main-Class': 'com.sahlbach.zipstarter.war.HelloWebWorld'
}
archiveName = 'warExample.war'
into('/') {
from project(':zipStarter').sourceSets.main.output
}
doLast {
println "Try this: java -jar warExample/build/libs/warExample.war"
println "Try gradle jettyRun and access http://localhost:8080/warExample/service/hello"
}
}
}