Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code to set the run.mode to production within WAR files.
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Call class="java.lang.System" name="setProperty">
<Arg>run.mode</Arg>
<Arg>production</Arg>
</Call>
</Configure>
val jettyWebPath = "src" / "main" / "webapp" / "WEB-INF" / "jetty-web.xml"
lazy val installProductionRunMode = task {
FileUtilities.copyFile("project" / "jetty-web.xml",
jettyWebPath,
log)
log.info("Copied jetty-web.xml into place")
None
} describedAs("Install a jetty-web.xml that sets the run mode to production")
lazy val superPackage = super.packageAction dependsOn(installProductionRunMode)
lazy val removeProductionRunMode = task {
FileUtilities.clean(jettyWebPath, log)
None
} describedAs("Remove jetty-web.xml and hence set run mode back to testing")
override def packageAction = removeProductionRunMode dependsOn(superPackage) describedAs BasicWebScalaProject.PackageWarDescription
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.