diff --git a/doc/how_to_run.md b/doc/how_to_run.md index 1806b71..2db71fb 100644 --- a/doc/how_to_run.md +++ b/doc/how_to_run.md @@ -7,33 +7,22 @@ If you want to test GitBucket, input following command at the root directory of the source tree. ``` -C:\gitbucket> sbt ~container:start +$ sbt jetty:start jetty:join ``` Then access to `http://localhost:8080/` by your browser. The default administrator account is `root` and password is `root`. +`CTRL + C` to shutdown. + for Developers -------- If you want to modify source code and confirm it, you can run GitBucket in auto reloading mode as following: -Windows: - ``` -C:\gitbucket> sbt +$ sbt ... -> container:start -... -> ~ ;copy-resources;aux-compile -``` - -Linux: - -``` -~/gitbucket$ ./sbt.sh -... -> container:start -... -> ~ ;copy-resources;aux-compile +> jetty:start +> ~compile ``` Build war file @@ -41,16 +30,8 @@ To build war file, run the following command: -Windows: - ``` -C:\gitbucket> sbt package -``` - -Linux: - -``` -~/gitbucket$ ./sbt.sh package +$ sbt package ``` `gitbucket_2.11-x.x.x.war` is generated into `target/scala-2.11`. diff --git a/project/build.scala b/project/build.scala index 5668beb..22bf343 100644 --- a/project/build.scala +++ b/project/build.scala @@ -1,8 +1,7 @@ import sbt._ import Keys._ -import org.scalatra.sbt._ import play.twirl.sbt.SbtTwirl -import play.twirl.sbt.Import.TwirlKeys._ +import com.earldouglas.xwp.JettyPlugin import sbtassembly._ import sbtassembly.AssemblyKeys._ @@ -17,7 +16,7 @@ "gitbucket", file(".") ) - .settings(ScalatraPlugin.scalatraWithJRebel: _*) +// .settings(ScalatraPlugin.scalatraWithJRebel: _*) .settings( test in assembly := {}, assemblyMergeStrategy in assembly := { @@ -59,9 +58,9 @@ "com.typesafe.slick" %% "slick" % "2.1.0", "com.novell.ldap" % "jldap" % "2009-10-07", "com.h2database" % "h2" % "1.4.180", - "ch.qos.logback" % "logback-classic" % "1.1.1" % "container", - "org.eclipse.jetty" % "jetty-webapp" % "8.1.16.v20140903" % "container;provided", - "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;provided;test" artifacts Artifact("javax.servlet", "jar", "jar"), + "ch.qos.logback" % "logback-classic" % "1.1.1", + "org.eclipse.jetty" % "jetty-webapp" % "8.1.16.v20140903" % "provided", + "javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided", "junit" % "junit" % "4.12" % "test", "com.mchange" % "c3p0" % "0.9.5", "com.typesafe" % "config" % "1.2.1", @@ -75,5 +74,5 @@ testOptions in Test += Tests.Setup( () => new java.io.File("target/gitbucket_home_for_test").mkdir() ), fork in Test := true, packageOptions += Package.MainClass("JettyLauncher") - ).enablePlugins(SbtTwirl) + ).enablePlugins(SbtTwirl, JettyPlugin) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 7eee39e..5ed803b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,5 @@ scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature") -addSbtPlugin("org.scalatra.sbt" % "scalatra-sbt" % "0.3.5") -addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.0.4") -addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.8") -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.12.0") +addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.0.4") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.12.0") +addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "2.1.0") \ No newline at end of file diff --git a/src/main/resources/logback-test.xml b/src/main/resources/logback-test.xml new file mode 100644 index 0000000..efdb6ac --- /dev/null +++ b/src/main/resources/logback-test.xml @@ -0,0 +1,26 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + gitbucket.log + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 1f196bd..714265e 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -16,12 +16,11 @@ - + \ No newline at end of file