Skip to content

Instantly share code, notes, and snippets.

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" "">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Call class="java.lang.System" name="setProperty">
val jettyWebPath = "src" / "main" / "webapp" / "WEB-INF" / "jetty-web.xml"
lazy val installProductionRunMode = task {
FileUtilities.copyFile("project" / "jetty-web.xml",
log)"Copied jetty-web.xml into place")
} 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)
} 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