0
我有一個gradle build,必須將預構建的jar文件作爲工件發佈。由於某種原因,它沒有被拾起。下面是一個簡化版本重現它:Gradle未發佈自定義jar神器
文件夾內容:
settings.gradle
build.gradle
some.jar
settings.gradle:
rootProject.name = 'some'
的build.gradle:
apply plugin: 'base'
apply plugin: 'maven-publish'
group = 'foo.bar'
version = '1.0'
task copyPrebuilt(type: Copy) {
from(projectDir) {
include 'some.jar'
rename 'some', "some-$version"
}
into distsDir
}
artifacts {
// should be 'archives'?
// http://stackoverflow.com/questions/39068090/gradle-archives-artifacts-not-populated-to-default-configuration
'default' (file("$distsDir/some-${version}.jar")) {
name 'some'
type 'jar'
builtBy copyPrebuilt
}
}
some-1.0.jar
不會被複制到~/.m2/repository/foo/bar/some/1.0
通過gradle publishToMavenLocal
任何線索?