在 gradle 中发布非 jar 文件
Publishing non-jar files in gradle
我有一组文件(特别是一组 json 文档)需要发布到我的 Maven 存储库。
如何使用发布并在工件中指定目录。
publications {
myPublication(MavenPublication) {
artifact(/path/to/dir>) // directory that contains files to publish
}
}
您可以创建一个任务来压缩所有文档,然后发布压缩文件。
task jsonZip(type: Zip) {
source file(/path/to/dir)
}
publications {
myPublication(MavenPublication) {
artifact jsonZip.archivePath
}
}
我有一组文件(特别是一组 json 文档)需要发布到我的 Maven 存储库。
如何使用发布并在工件中指定目录。
publications {
myPublication(MavenPublication) {
artifact(/path/to/dir>) // directory that contains files to publish
}
}
您可以创建一个任务来压缩所有文档,然后发布压缩文件。
task jsonZip(type: Zip) {
source file(/path/to/dir)
}
publications {
myPublication(MavenPublication) {
artifact jsonZip.archivePath
}
}