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

Commit 1a1885b

Browse files
authored
Merge pull request #44 from k4ml/gretty
Add gretty plugin to run the app from command line
2 parents 0014788 + a7d6ef7 commit 1a1885b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
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: 7 additions & 0 deletions
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()
@@ -19,3 +21,8 @@ dependencies {
1921
compile group: 'javax', name: 'javaee-api', version: '7.0'
2022
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2123
}
24+
25+
gretty {
26+
contextPath = '/'
27+
servletContainer = 'jetty9'
28+
}

0 commit comments

Comments
 (0)