mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Use the default jar file if no Main-Class attribute was found.
Fixes https://github.com/cbeust/kobalt/issues/384
This commit is contained in:
parent
c5405177b5
commit
ed9c4e6636
1 changed files with 3 additions and 0 deletions
|
@ -100,7 +100,10 @@ class ApplicationPlugin @Inject constructor(val configActor: ConfigActor<Applica
|
|||
}
|
||||
|
||||
private fun runJarFile(project: Project, context: KobaltContext, config: ApplicationConfig) : TaskResult {
|
||||
// If the user specified a Main-Class attribute when creating their jar file manifest, use that. Otherwise,
|
||||
// use the default jar file name and hope there's a main class in it
|
||||
val fileName = project.projectProperties.get(Archives.JAR_NAME_WITH_MAIN_CLASS)?.toString()
|
||||
?: project.projectProperties.get(Archives.JAR_NAME)?.toString()
|
||||
?: throw KobaltException("Couldn't find any jar file with a main class in it")
|
||||
|
||||
val jarFileName = KFiles.joinDir(KFiles.libsDir(project), fileName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue