-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
51 lines (39 loc) · 1.86 KB
/
build.sbt
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
name := """myFirstApp"""
scriptClasspath := Seq("*")
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
javaJdbc,
cache,
javaWs,
// 增加mybatis , google Inject 與 mariadb 需要的jar檔
"org.mybatis" % "mybatis" % "3.4.1",
"org.mybatis" % "mybatis-guice" % "3.8",
"com.google.inject.extensions" % "guice-multibindings" % "4.1.0",
"org.mariadb.jdbc" % "mariadb-java-client" % "1.4.6",
// Java寄信功能
"javax.mail" % "javax.mail-api" % "1.5.6",
"javax.mail" % "mail" % "1.4.7",
// Spring Aop
"org.springframework" % "spring-aop" % "4.2.4.RELEASE",
// fast-classpath-scanner
"io.github.lukehutch" % "fast-classpath-scanner" % "2.0.9",
// Test
"junit" % "junit" % "4.12"
)
// Compile the project before generating Eclipse files, so that .class files for views and routes are present
EclipseKeys.preTasks := Seq(compile in Compile)
// Java project. Don't expect Scala IDE
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java
// Use .class files instead of generated .scala files for views and routes
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources)
// if you want to running compile , this "fork in run" must set false
fork in run := false
// 以下這兩段必須要增加到sbt檔案,目的是要把我們mybaits的xml,編譯到classpath
// 讓myBaits知道要執行那個編譯過後的xml檔案
// Add app folder as resource directory so that mapper xml files are in the classpath
unmanagedResourceDirectories in Compile <+= baseDirectory( _ / "app" )
// but filter out java and html files that would then also be copied to the classpath
excludeFilter in Compile in unmanagedResources := "*.java" || "*.html"
routesGenerator := InjectedRoutesGenerator