-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
69 lines (59 loc) · 2.04 KB
/
Copy pathbuild.gradle
File metadata and controls
69 lines (59 loc) · 2.04 KB
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
// Apply the java-library plugin to add support for Java Library
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath group: 'com.bmuschko', name: 'gradle-tomcat-plugin', version: '2.5'
classpath "mysql:mysql-connector-java:8.0.15"
}
}
plugins {
id 'java-library'
id 'java'
id 'eclipse'
id 'war'
}
// これだけidで定義できない
apply plugin: 'com.bmuschko.tomcat'
// versionの指定
ext {
tomcatVersion = '9.0.10'
mySQLVersion = '8.0.15'
}
sourceSets {
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
}
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
}
dependencies {
//tomcat & サーブレットの設定
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
providedCompile group: 'javax.servlet.jsp', name: 'javax.servlet.jsp-api', version: '2.3.1'
compile group: 'org.apache.taglibs', name: 'taglibs-standard-impl', version: '1.2.5'
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}"
tomcat "org.apache.tomcat.embed:tomcat-embed-logging-juli:9.0.0.M6"
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") {
exclude group: "org.eclipse.jdt.core.compiler", module: "ecj"
}
// JUnit
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.2.0'
// MySQL
implementation "mysql:mysql-connector-java:$mySQLVersion"
implementation('com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.5')
implementation('com.fasterxml.jackson.core:jackson-core:2.8.5')
implementation('com.fasterxml.jackson.core:jackson-databind:2.8.5')
}
// tomcatの設定
tomcat {
httpProtocol = 'org.apache.coyote.http11.Http11Nio2Protocol'
ajpProtocol = 'org.apache.coyote.ajp.AjpNio2Protocol'
//プロジェクト名(コンテキストパス)
contextPath = 'Sample'
}