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

时间:2016-12-14 11:43:10

标签: gradle

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

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

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

2 个答案:

答案 0 :(得分:-1)

在没有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(...)

答案 1 :(得分:-1)

您需要一个pom.xml文件,其中包含有关工件的更多信息,作为依存关系。

相关问题