我还有以下附加组件和发布,但是我想将其发布为软件组件,并在注册时使用from
方法而不是artifact
,我该如何实现? (使用5.3.1)
sourceSets {
val main by getting
val tlib by creating {
compileClasspath += main.output
runtimeClasspath += main.output
}
val test by getting {
compileClasspath += tlib.output
runtimeClasspath += tlib.output
}
}
configurations {
val tlibCompile by getting {
extendsFrom(configurations["implementation"])
}
}
publishing {
publications {
val tlibJar by tasks.registering(Jar::class) {
from(sourceSets["tlib"].output)
}
val tlibSourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["tlib"].allSource)
}
register("mavenTLib", MavenPublication::class) {
artifactId = "phg-entity-tlib"
artifact(tlibJar.get())
artifact(tlibSourcesJar.get())
}
}
}