mirror of
https://github.com/sbt/sbt.git
synced 2026-08-22 06:07:24 +02:00
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:
@@ -109,9 +109,11 @@ class XSbt(info: ProjectInfo) extends ParentProject(info) with NoCrossPaths
|
|||||||
class WebAppProject(info: ProjectInfo) extends Base(info)
|
class WebAppProject(info: ProjectInfo) extends Base(info)
|
||||||
{
|
{
|
||||||
val jetty = "org.mortbay.jetty" % "jetty" % "6.1.14" % "optional"
|
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 jetty7server = "org.eclipse.jetty" % "jetty-server" % "7.0.1.v20091125" % "optional"
|
||||||
val jetty7webapp = "org.eclipse.jetty" % "jetty-webapp" % "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
|
val optional = Configurations.Optional
|
||||||
|
|
||||||
|
|||||||
@@ -388,6 +388,7 @@ abstract class BasicWebScalaProject extends BasicScalaProject with WebScalaProje
|
|||||||
def scanInterval = p.scanInterval
|
def scanInterval = p.scanInterval
|
||||||
def port = jettyPort
|
def port = jettyPort
|
||||||
def log = p.log
|
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.*/
|
/** This is the classpath used to determine what classes, resources, and jars to put in the war file.*/
|
||||||
def webappClasspath = publicClasspath
|
def webappClasspath = publicClasspath
|
||||||
@@ -420,6 +421,8 @@ abstract class BasicWebScalaProject extends BasicScalaProject with WebScalaProje
|
|||||||
/** The port that Jetty runs on. */
|
/** The port that Jetty runs on. */
|
||||||
def jettyPort: Int = JettyRunner.DefaultPort
|
def jettyPort: Int = JettyRunner.DefaultPort
|
||||||
|
|
||||||
|
def jettyEnvXml : Option[File] = None
|
||||||
|
|
||||||
lazy val jettyReload = task { jettyInstance.reload(); None } describedAs(JettyReloadDescription)
|
lazy val jettyReload = task { jettyInstance.reload(); None } describedAs(JettyReloadDescription)
|
||||||
lazy val jettyRestart = jettyStop && jettyRun
|
lazy val jettyRestart = jettyStop && jettyRun
|
||||||
lazy val jettyStop = jettyStopAction
|
lazy val jettyStop = jettyStopAction
|
||||||
|
|||||||
@@ -96,11 +96,13 @@ trait DefaultJettyConfiguration extends JettyConfiguration
|
|||||||
def scanDirectories: Seq[File]
|
def scanDirectories: Seq[File]
|
||||||
def scanInterval: Int
|
def scanInterval: Int
|
||||||
|
|
||||||
|
|
||||||
def contextPath: String
|
def contextPath: String
|
||||||
def port: Int
|
def port: Int
|
||||||
/** The classpath containing the classes, jars, and resources for the web application. */
|
/** The classpath containing the classes, jars, and resources for the web application. */
|
||||||
def classpath: PathFinder
|
def classpath: PathFinder
|
||||||
def parentLoader: ClassLoader
|
def parentLoader: ClassLoader
|
||||||
|
def jettyEnv: Option[File]
|
||||||
}
|
}
|
||||||
abstract class CustomJettyConfiguration extends JettyConfiguration
|
abstract class CustomJettyConfiguration extends JettyConfiguration
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
import org.mortbay.jetty.{Handler, Server}
|
import org.mortbay.jetty.{Handler, Server}
|
||||||
import org.mortbay.jetty.nio.SelectChannelConnector
|
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.log.{Log, Logger => JLogger}
|
||||||
import org.mortbay.util.Scanner
|
import org.mortbay.util.Scanner
|
||||||
import org.mortbay.xml.XmlConfiguration
|
import org.mortbay.xml.XmlConfiguration
|
||||||
|
import org.mortbay.jetty.plus.webapp.{EnvConfiguration, Configuration=>PlusConfiguration}
|
||||||
|
|||||||
+3
-1
@@ -1,7 +1,9 @@
|
|||||||
|
|
||||||
import org.eclipse.jetty.server.{Server, Handler}
|
import org.eclipse.jetty.server.{Server, Handler}
|
||||||
import org.eclipse.jetty.server.nio.SelectChannelConnector
|
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.log.{Log, Logger => JLogger}
|
||||||
import org.eclipse.jetty.util.Scanner
|
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}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user