Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit f03ce0f

Browse files
committed
add gretty plugin to run the app from command line
1 parent 5de90b1 commit f03ce0f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
Code for the [Creating Web Applications with Http Servlets](http://kotlinlang.org/docs/tutorials/httpservlets.html) tutorial.
2+
3+
To run this from command line, we can use [gretty], a gradle plugin to run the application war under Jetty.
4+
5+
Run this command to start the app:-
6+
7+
gradle appStart
8+
9+
References - https://www.petrikainulainen.net/programming/gradle/getting-started-with-gradle-creating-a-web-application-project/
10+
11+
[gretty]:https://github.com/akhikhl/gretty/blob/master/changes.md

tutorials/servlet-web-applications/build.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ buildscript {
55
}
66
dependencies {
77
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
8+
classpath 'org.akhikhl.gretty:gretty:+'
89
}
910
}
1011

1112
apply plugin: 'kotlin'
1213
apply plugin: 'war'
14+
apply plugin: 'org.akhikhl.gretty'
1315

1416
repositories {
1517
jcenter()
@@ -31,4 +33,9 @@ sourceSets {
3133
srcDir "test/main/kotlin"
3234
}
3335
}
34-
}
36+
}
37+
38+
gretty {
39+
contextPath = '/'
40+
servletContainer = 'jetty9'
41+
}

0 commit comments

Comments
 (0)