Created
April 22, 2018 13:21
-
-
Save lasta/c67cd5539008c29d9dcfc5306e84d80b to your computer and use it in GitHub Desktop.
単独で実行可能な Ktor アプリケーション の jar を生成する ref: https://qiita.com/lasta/items/2c25ae5a875ba8da4f8a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar yourapplication.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gradle fatJar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar ${project.name}-${version}.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment