Building a self-executable jar with Gradle and Kotlin

前端 未结 7 1426
囚心锁ツ
囚心锁ツ 2020-12-08 18:40

I\'ve written a simple kotlin source file in order to get started, and a gradle script file. But I can\'t figure out how to add the main func to the manifest, so that the ja

相关标签:
7条回答
  • 2020-12-08 19:16

    Thanks, for me it worked adding the jar section

    jar {
        manifest {
            attributes 'Main-Class': 'com.photofiles.Application'
        }
    
        from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    }
    

    No need for the application plugin.

    0 讨论(0)
提交回复
热议问题