-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
49 lines (40 loc) · 1.37 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
apply plugin: 'war'
apply plugin: 'idea'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'org.eclipse.jetty:jetty-servlet:+'
compile 'org.eclipse.jetty:jetty-webapp:+'
compile 'org.eclipse.jetty:jetty-jsp:+'
compile 'org.eclipse.jetty:jetty-annotations:+'
compile fileTree(dir: 'lib', include: '*.jar')
compile 'javax.json:javax.json-api:1.0'
}
war.baseName = 'jason_plans'
war {
// unzip and add all jetty dependencies into the root of our war file
from {configurations.compile.collect {
project.zipTree(it)
}
}
// remove signature and unnecessary files
exclude "META-INF/*.SF", "META-INF/*.RSA", "about.html", "about_files/**", "readme.txt", "plugin.properties", "jetty-dir.css"
// include only the classes which will be used to start Embedded Jetty
from "$buildDir/classes/main"
exclude "com/myapp/"
// tells the class to run when the generate war be executed using 'java -jar'
manifest { attributes 'Main-Class': 'com.embedded.JettyStarter' }
}
// Once you will need some basic api (e.i. servlet api) for compilation, add embeddedJetty dependencies for compilation
//sourceSets.main.compileClasspath += configurations.embeddedJetty
// the same for eclipse classpath, so you can use it to edit your java files
/*
idea {
classpath {
plusConfigurations += configurations.embeddedJetty
}
}
*/