mirror of https://github.com/sbt/sbt.git
Configure jetty-env.xml. Allows specifying JNDI datasources. Inspired by maven-jetty-plugin.
Only takes effect when jettyEnvXml equals Some[File], by default None. Tested with jrebel.
This commit is contained in:
parent
23bda55124
commit
98cd577e1d
|
|
@ -109,9 +109,11 @@ class XSbt(info: ProjectInfo) extends ParentProject(info) with NoCrossPaths
|
|||
class WebAppProject(info: ProjectInfo) extends Base(info)
|
||||
{
|
||||
val jetty = "org.mortbay.jetty" % "jetty" % "6.1.14" % "optional"
|
||||
val jettyplus = "org.mortbay.jetty" % "jetty-plus" % "6.1.14" % "optional"
|
||||
|
||||
val jetty7server = "org.eclipse.jetty" % "jetty-server" % "7.0.1.v20091125" % "optional"
|
||||
val jetty7webapp = "org.eclipse.jetty" % "jetty-webapp" % "7.0.1.v20091125" % "optional"
|
||||
val jetty7plus = "org.eclipse.jetty" % "jetty-plus" % "7.0.1.v20091125" % "optional"
|
||||
|
||||
val optional = Configurations.Optional
|
||||
|
||||
|
|
|
|||
|
|
@ -388,6 +388,7 @@ abstract class BasicWebScalaProject extends BasicScalaProject with WebScalaProje
|
|||
def scanInterval = p.scanInterval
|
||||
def port = jettyPort
|
||||
def log = p.log
|
||||
def jettyEnv = jettyEnvXml
|
||||
}
|
||||
/** This is the classpath used to determine what classes, resources, and jars to put in the war file.*/
|
||||
def webappClasspath = publicClasspath
|
||||
|
|
@ -420,6 +421,8 @@ abstract class BasicWebScalaProject extends BasicScalaProject with WebScalaProje
|
|||
/** The port that Jetty runs on. */
|
||||
def jettyPort: Int = JettyRunner.DefaultPort
|
||||
|
||||
def jettyEnvXml : Option[File] = None
|
||||
|
||||
lazy val jettyReload = task { jettyInstance.reload(); None } describedAs(JettyReloadDescription)
|
||||
lazy val jettyRestart = jettyStop && jettyRun
|
||||
lazy val jettyStop = jettyStopAction
|
||||
|
|
|
|||
|
|
@ -95,12 +95,14 @@ trait DefaultJettyConfiguration extends JettyConfiguration
|
|||
def war: Path
|
||||
def scanDirectories: Seq[File]
|
||||
def scanInterval: Int
|
||||
|
||||
|
||||
def contextPath: String
|
||||
def port: Int
|
||||
/** The classpath containing the classes, jars, and resources for the web application. */
|
||||
def classpath: PathFinder
|
||||
def parentLoader: ClassLoader
|
||||
def jettyEnv: Option[File]
|
||||
}
|
||||
abstract class CustomJettyConfiguration extends JettyConfiguration
|
||||
{
|
||||
|
|
@ -144,4 +146,4 @@ private class JettyLoggerBase(delegate: AbstractLogger)
|
|||
else sb.append(piece).append(argStr)
|
||||
}.toString
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
import org.mortbay.jetty.{Handler, Server}
|
||||
import org.mortbay.jetty.nio.SelectChannelConnector
|
||||
import org.mortbay.jetty.webapp.{WebAppClassLoader, WebAppContext}
|
||||
import org.mortbay.jetty.webapp.{WebAppClassLoader, WebAppContext, WebInfConfiguration, Configuration, JettyWebXmlConfiguration, TagLibConfiguration, WebXmlConfiguration}
|
||||
import org.mortbay.log.{Log, Logger => JLogger}
|
||||
import org.mortbay.util.Scanner
|
||||
import org.mortbay.xml.XmlConfiguration
|
||||
import org.mortbay.xml.XmlConfiguration
|
||||
import org.mortbay.jetty.plus.webapp.{EnvConfiguration, Configuration=>PlusConfiguration}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
|
||||
import org.eclipse.jetty.server.{Server, Handler}
|
||||
import org.eclipse.jetty.server.nio.SelectChannelConnector
|
||||
import org.eclipse.jetty.webapp.{WebAppClassLoader, WebAppContext}
|
||||
import org.eclipse.jetty.webapp.{WebAppClassLoader, WebAppContext, WebInfConfiguration, Configuration, FragmentConfiguration, JettyWebXmlConfiguration, TagLibConfiguration, WebXmlConfiguration}
|
||||
import org.eclipse.jetty.util.log.{Log, Logger => JLogger}
|
||||
import org.eclipse.jetty.util.Scanner
|
||||
import org.eclipse.jetty.xml.XmlConfiguration
|
||||
import org.eclipse.jetty.xml.XmlConfiguration
|
||||
import org.eclipse.jetty.plus.webapp.{EnvConfiguration, Configuration=>PlusConfiguration}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue