This repository has been archived by the owner on Nov 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle
99 lines (78 loc) · 2.27 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
buildscript {
ext {
springBootVersion = '1.5.8.RELEASE'
alpnAgentVersion = '2.0.6'
jettyVersion = '9.4.7.v20170914'
}
repositories {
jcenter()
maven { url "https://repo.spring.io/release" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
}
}
plugins {
id 'java'
id 'application'
id 'eclipse'
id 'idea'
}
apply plugin: 'org.springframework.boot'
group = 'org.test'
version = '0.0.1-SNAPSHOT'
description = "demo-http2"
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations {
javaAgent { description "additional lib as jvm agent" }
}
dependencyManagement {
imports {
ext['jetty.version'] = "${jettyVersion}"
}
}
repositories {
jcenter()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter')
compile('org.springframework:spring-webmvc')
// jetty
compile('org.springframework.boot:spring-boot-starter-jetty')
compile("org.eclipse.jetty.http2:http2-server:${jettyVersion}")
compile("org.eclipse.jetty:jetty-alpn-server:${jettyVersion}")
testCompile('org.springframework.boot:spring-boot-starter-test') {
exclude(module: 'commons-logging')
}
testCompile 'com.squareup.okhttp3:okhttp:3.4.1'
// ALPN
compile("org.mortbay.jetty.alpn:jetty-alpn-agent:${alpnAgentVersion}")
javaAgent("org.mortbay.jetty.alpn:jetty-alpn-agent:${alpnAgentVersion}")
}
defaultTasks 'bootRun'
mainClassName = 'demo.DemoHttp2Application'
applicationDefaultJvmArgs = ["-javaagent:lib/jetty-alpn-agent-${alpnAgentVersion}.jar"]
test {
systemProperty "javax.net.ssl.trustStoreType", "jks"
systemProperty "javax.net.ssl.trustStore", "src/main/resources/sample.jks"
systemProperty "javax.net.debug", "ssl"
systemProperty "javax.net.ssl.trustStorePassword", "changeit"
jvmArgs = ["-javaagent:lib/jetty-alpn-agent-${alpnAgentVersion}.jar"]
}
distributions {
main.contents {
from(configurations.javaAgent) {
into "lib"
}
}
}
task copyAlpnAgentJar (type:Copy) {
from (configurations.javaAgent)
into("lib")
}
tasks["eclipse"].dependsOn(copyAlpnAgentJar)
processResources.dependsOn copyAlpnAgentJar
clean {
delete "lib/*.jar"
}