我为多项目构建设置了下一个配置:
allprojects {
apply plugin: 'maven-publish'
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = rootProject.version
group = rootProject.group
archivesBaseName = "PREFIX-${it.name}"
}
但前缀仅适用于构建的工件,而不是当我执行发布任务时。有没有办法用前缀?
配置发布答案 0 :(得分:0)
根据“Identity values in the generated POM”,下一个配置应该有效:
subprojects { project ->
...
publishing {
publications {
maven(MavenPublication) {
artifactId "PREFIX-${project.name}"
from components.java
}
}
}
}