在gradle中发布非jar文件 [英] Publishing non-jar files in gradle
本文介绍了在gradle中发布非jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一组文件(特别是一组json文档),我需要发布到我的Maven仓库。
如何使用发布并指定
publications {
myPublication(MavenPublication){
artifact(/ path / to / dir>)//包含要发布文件的目录
}
}
任务jsonZip(类型:Zip){
源文件(/ path / to / dir)
}
出版物{
myPublication(MavenPublication){
artifact jsonZip.archivePath
}
}
I am having a set of files (specifically a set of json documents) that I need to publish to my Maven repository.
How do I use publishing and specify the directory in the artifact.
publications {
myPublication(MavenPublication) {
artifact(/path/to/dir>) // directory that contains files to publish
}
}
解决方案
You can create a task to zip all your documents and then publish the zip.
task jsonZip(type: Zip) {
source file(/path/to/dir)
}
publications {
myPublication(MavenPublication) {
artifact jsonZip.archivePath
}
}
这篇关于在gradle中发布非jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文