Tag: shadowjar

在MANIFEST.MF中将Kotlin类指定为Main-Class入口点?

我如何明确告诉shadowJar使用Kotlin文件作为生成的uberJar的入口点? (或者,你喜欢胖胖的JAR 。) 笨拙地编辑META-INF/MANIFEST.MF并将其替换为zip文件(使用GUI将其放回): thufir@dur:~/NetBeansProjects/kotlin/build/libs$ thufir@dur:~/NetBeansProjects/kotlin/build/libs$ ll total 900 drwxrwxr-x 2 thufir thufir 4096 Nov 5 03:42 ./ drwxrwxr-x 8 thufir thufir 4096 Nov 5 03:42 ../ -rw-rw-r– 1 thufir thufir 903184 Nov 5 03:42 kotlinAdder.jar thufir@dur:~/NetBeansProjects/kotlin/build/libs$ thufir@dur:~/NetBeansProjects/kotlin/build/libs$ jar xf kotlinAdder.jar thufir@dur:~/NetBeansProjects/kotlin/build/libs$ thufir@dur:~/NetBeansProjects/kotlin/build/libs$ ll total 928 drwxrwxr-x 7 thufir thufir 4096 Nov 5 03:42 ./ […]

如何导入Kotlin(Gradle)构建的ShadowJar插件?

构建失败: thufir@dur:~/NetBeansProjects/kotlin_dsl$ thufir@dur:~/NetBeansProjects/kotlin_dsl$ gradle clean run > Configure project : e: /home/thufir/NetBeansProjects/kotlin_dsl/build.gradle.kts:4:12: Unresolved reference: github FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project ‘kotlin_dsl’. > Could not open cache directory 74ykawxta6db3b2bfk9grjikp (/home/thufir/.gradle/caches/4.3.1/gradle-kotlin-dsl/74ykawxta6db3b2bfk9grjikp). > Internal error: unable to compile script, see log for details * Try: Run with […]

找不到Kotlin脚本Gradle的kotlin-gradle-plugin

构建失败,类路径错误: thufir@dur:~/NetBeansProjects/kotlinShadowJar$ thufir@dur:~/NetBeansProjects/kotlinShadowJar$ gradle clean FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project ‘kotlinShadowJar’. > Could not resolve all files for configuration ‘:classpath’. > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:. Searched in the following locations: file:/home/thufir/.gradle/caches/4.3.1/embedded-kotlin-repo-1.1.51-1/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom file:/home/thufir/.gradle/caches/4.3.1/embedded-kotlin-repo-1.1.51-1/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar https://repo.gradle.org/gradle/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.pom https://repo.gradle.org/gradle/repo/org/jetbrains/kotlin/kotlin-gradle-plugin//kotlin-gradle-plugin-.jar Required by: project : * Try: Run with […]

什么是.kotlin_builtins文件,我可以从我的uberjars中忽略它们?

我正在将proguard集成到我的Gradle构建中,用于在Kotlin中编写的应用程序。 我发现proguard正在剥离Kotlin标准库(就像它应该在我简单的Hello World程序中那样),但是在我的jar文件中留下了一堆扩展名为.kotlin_builtins的文件。 当我配置我的gradle任务来排除这些文件时,该程序仍然显示正常工作。 这些文件是什么,他们必须随我的可执行uberjar? 这里是我的build.gradle文件的内容供参考: buildscript { ext.kotlin_version = '1.0.5' ext.shadow_version = '1.2.4' repositories { mavenCentral() maven { url "https://plugins.gradle.org/m2/" } flatDir dirs: "gradle/proguard" } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_version" classpath ":proguard:" } } apply plugin: 'kotlin' apply plugin: 'application' apply plugin: 'com.github.johnrengelman.shadow' mainClassName = 'namespace.MainKt' defaultTasks 'run' repositories { mavenCentral() } dependencies […]