Created
March 2, 2011 14:48
-
-
Save noelwelsh/851037 to your computer and use it in GitHub Desktop.
Code to set the run.mode to production within WAR files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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