Skip to content

Instantly share code, notes, and snippets.

@lasta
Created April 22, 2018 13:21
Show Gist options
  • Save lasta/c67cd5539008c29d9dcfc5306e84d80b to your computer and use it in GitHub Desktop.
Save lasta/c67cd5539008c29d9dcfc5306e84d80b to your computer and use it in GitHub Desktop.
単独で実行可能な Ktor アプリケーション の jar を生成する ref: https://qiita.com/lasta/items/2c25ae5a875ba8da4f8a
java -jar yourapplication.jar
task fatJar(type: Jar) {
manifest {
attributes "Implementation-Title": project.name,
"Implementation-Version": version,
"Main-Class": mainClassName
}
baseName = project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
exclude "META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA"
with jar
}
gradle fatJar
java -jar ${project.name}-${version}.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment