当gradle'maven-publish'插件生成pom.xml时,如何指示它将配置添加到该pom中列出的依赖项?
在当前的'maven'插件中,以下行将用于指示它将“myCustom”配置包含为编译依赖项:
conf2ScopeMappings.addMapping(1, configurations.myCustom, "compile")
我实际上希望使用新的'maven-publish'插件获得相同的功能
的build.gradle:
apply plugin: 'maven-publish'
configurations {
myCustom
}
dependencies {
myCustom 'my:custom-dep:1.0'
}
publishing {
publications {
myPublication(MavenPublication) {
}
}
}
运行gradle generatePomFileForMyPublicationPublication
目前的结果:
<project xsi: ... >
<modelVersion>4.0.0</modelVersion>
<groupId>com.group</groupId>
<artifactId>id</artifactId>
<version>0.0.1</version>
<packaging>pkg</packaging>
<-- need custom-dep dependency here
</project>