gradle - gradlew kts 多项目输出 jar
问题描述
我如何从多项目创建 jar。
gradlew -q 项目输出:
根文件夹中的build.gradle.kts (test)
plugins {
java
}
version = "0.0.1"
group = "up"
allprojects {
repositories {
mavenCentral()
}
plugins.apply("java")
java.sourceCompatibility = JavaVersion.VERSION_1_10
tasks {
compileJava {
options.encoding = "UTF-8"
}
compileTestJava {
options.encoding = "UTF-8"
}
}
}
settings.gradle.kts :
rootProject.name = "test"
include("config","gitrawdata","analyzer","webgen","cli")
分析器的 build.gradle.kts:
plugins {
`java-library`
}
dependencies {
implementation(project(":config"))
implementation(project(":gitrawdata"))
testImplementation("junit:junit:4.+")
}
cli的build.gradle.kts:
plugins {
java
application
}
application.mainClass.set("up.visulog.cli.CLILauncher")
dependencies {
implementation(project(":analyzer"))
implementation(project(":config"))
implementation(project(":gitrawdata"))
testImplementation("junit:junit:4.+")
}
config、gitrawdata、webgen的build.gradle.kts:
plugins {
`java-library`
}
dependencies {
testImplementation("junit:junit:4.+")
}
如何从多模块项目创建一个 jar?
gradlew build 生成空的 jar 文件。
解决方案
推荐阅读
- node.js - 如何处理可以同时删除同一个文件的多个异步操作?
- statistics - 选择数据框中列的前 20 个值?
- wordpress - Woocommerce 需要更新 minicart 图标旁边的显示总数
- php - 重力表单/WordPress 填充来自 ACF 字段的单选按钮选项
- google-cloud-platform - 如何在 gcs 存储桶上添加默认的“项目查看者”权限?
- r - 根据 R Shiny 中的 observeEvent 的链接选择触发 selectInput 的更新
- promise - “Promise”类型上不存在“属性”
| 承诺 | 承诺 | 表单数据阅读器 | 承诺 |未定义'.deno-ts - kubernetes - GCP - 使用 HPA 根据自定义日志记录指标扩展 GKE pod
- java - Java CMS 垃圾回收最小堆
- r - 根据 R 中的特定行值将数据帧拆分为多个数据帧