Skip to content

Instantly share code, notes, and snippets.

@lyhcode
Created October 29, 2011 01:02
Show Gist options
  • Save lyhcode/1323943 to your computer and use it in GitHub Desktop.
Save lyhcode/1323943 to your computer and use it in GitHub Desktop.
Gradle jettyRun with jetty-env.xml
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'jetty'
repositories {
mavenCentral()
}
dependencies {
compile group: 'javax.servlet', name: 'servlet-api', version: '2.5'
compile group: 'javax.servlet', name: 'jsp-api', version: '2.0'
}
jettyRun {
httpPort = 8080
}
<?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">
<Get name="securityHandler">
<Set name="userRealm">
<New class="org.mortbay.jetty.security.HashUserRealm">
<Set name="name">default</Set>
<Set name="config">realm.properties</Set>
</New>
</Set>
</Get>
</Configure>
admin: admin, supervisor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment