Skip to content

ritschwumm/xsbt-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Another webapp plugin for sbt

To build this code, get and install SBT from
    https://github.com/sbt/sbt

Get and install these plugins before building:
    https://github.com/ritschwumm/xsbt-util
    https://github.com/ritschwumm/xsbt-classpath

Build and publish the plugin:
    git clone git@github.com:ritschwumm/xsbt-webapp.git
    cd xsbt-webapp
    sbt publish-local

Add the plugin to your project in project/plugins.sbt:
    addSbtPlugin("de.djini" % "xsbt-webapp" % <version>)

Run the webapp task to get a web application directory.

Then run the webappWar task to get a zipped up war file.

Resource libraries can be added like this:

    libraryDependencies += "com.test" % "foobar" % "0.1.0" % "webapp"

To deploy the webapp to a servlet container e.g. tomcat, include something like this in the build.sbt:

    webappDeployName    := "ROOT"

    webappDeployBase    :=
            Option(System getenv "CATALINA_HOME")
            .map        (file)
            .map        { _ / "webapps" }
            .filter     { _.isDirectory }

Then run the webappDeploy task; it will first delete $CATALINA_HOME/webapps/ROOT
and $CATALINA_HOME/webapps/ROOT.war and then copy an exploded webpp directory to
$CATALINA_HOME/webapps/ROOT .

About

A minimalistic webapp plugin for sbt

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages