我想创建一个示例依赖项,从gradle项目到项目再到maven
apply plugin: "maven-publish"
apply plugin: "java"
repositories {
mavenLocal()
}
sourceSets {
main {
java {
srcDirs 'java'
}
resources {
srcDirs 'build'
}
}
}
task sourcesJar(type: Jar) {
from 'build/libs'
classifier = 'sources'
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'or.gradle.sample'
artifactId = 'sort-array'
version = '1.1'
artifact sourcesJar
}
}
repositories {
mavenLocal()
}
}
但是当我键入:
gradle publishToMavenLocal
我有日志:
... Publishing to repository null ....
和构建失败