1
我的gradle构建副本文件。我想用复制任务的输出作为Maven构件输入出版从副本任务发布工件
例如:
task example(type: Copy) {
from "build.gradle" // use as example
into "build/distributions"
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact example
}
}
}
的Gradle,但不喜欢它:
* What went wrong:
A problem occurred configuring project ':myproject'.
> Exception thrown while executing model rule: PublishingPlugin.Rules#publishing(ExtensionContainer)
> Cannot convert the provided notation to an object of type MavenArtifact: task ':myproject:example'.
The following types/formats are supported:
- Instances of MavenArtifact.
- Instances of AbstractArchiveTask, for example jar.
- Instances of PublishArtifact
- Maps containing a 'source' entry, for example [source: '/path/to/file', extension: 'zip'].
- Anything that can be converted to a file, as per Project.file()
为什么?
据我所知,任务示例的输出应该由Copy任务设置。我认为它可以转换为一些文件。所以它应该用作发布任务的输入,作为文件。但是错误信息告诉我我错了。
我该如何解决?
感谢
我一直在寻找这个答案近一个星期。救世主:) – CoderSpinoza