Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

War artifact name is included in route resolution #738

Closed
hmarggraff opened this issue Nov 19, 2018 · 2 comments
Closed

War artifact name is included in route resolution #738

hmarggraff opened this issue Nov 19, 2018 · 2 comments
Assignees
Milestone

Comments

@hmarggraff
Copy link

Ktor Version

1.0.0-rc

Ktor Engine Used(client or server and name)

Servlet (Tomcat)

JVM Version, Operating System and Relevant Context

JVM 8.x Win 10

Feedback

When a web app is deployed via x.war, then routes in ktor must start with /x. I.e. renaming the war file results in failing routes. Ktor seems to use the wrong path for routing. (Not dispatch path, but coyote path)

@hmarggraff
Copy link
Author

buildscript {
ext.tomcat_plugin_version = '2.4.2'
ext.tomcat_version = '9.0.4'

repositories {
    jcenter()
}
dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    //classpath "com.bmuschko:gradle-tomcat-plugin:$tomcat_plugin_version"
}

}

apply plugin: 'kotlin'
apply plugin: 'war'

sourceSets {
main.kotlin.srcDirs = [ 'src' ]
main.resources.srcDirs = [ 'resources' ]
}

repositories {
jcenter()
maven { url "https://kotlin.bintray.com/ktor" }
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "io.ktor:ktor-server-servlet:$ktor_version"
compile "io.ktor:ktor-html-builder:$ktor_version"
compile "org.slf4j:slf4j-jdk14:$slf4j_version"
}

war {
archiveName = 'x.war'
webXml = file('myweb.xml') // copies a file to WEB-INF/web.xml
}

@cy6erGn0m
Copy link
Contributor

Fixed in 1.2.0-rc2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants