gpt4 book ai didi

gradle - 是否可以在没有 pom.xml 的情况下发布 Maven 工件?

转载 作者:行者123 更新时间:2023-12-03 02:43:33 25 4
gpt4 key购买 nike

我们有非常独特的情况。我们正在打包来自不同机器(Ubuntu 和 Windows 7)的 linux 和 Windows 平台的本地二进制文件。我们正在使用标准 maven-publish插入。

我们使用相同的 Maven GAV 发布工件,它们仅在 classifier 上有所不同。 .这会在发布过程中引起问题,因为第二个平台将尝试发布 pom.xml ,已经发布。部署用户没有任何覆盖访问权限。

有没有办法在不发布 pom.xml 的情况下发布 maven 工件? ?

最佳答案

在没有 pom.xml 的情况下发布到 maven 没有意义。尝试这个:

apply plugin: 'maven-publish'

task ubuntuZip(type: Zip) {
classifier 'ubuntu'
// TODO configure
}
task windows7Zip(type: Zip) {
classifier 'windows7'
// TODO configure
}
publishing {
publications {
maven(MavenPublication) {
artifact ubuntuZip
artifact windows7Zip
artifact [source: 'path/to/random/file.txt', classifier: 'foo']
}
}
}

MavenPublication.artifact(...)

关于gradle - 是否可以在没有 pom.xml 的情况下发布 Maven 工件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41141742/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com