我有一个gradle项目,它有jvm(Scala)子项目,我想将他们所有的jar发布到m2存储库。
我这样申请maven-publish
......
allprojects {
apply plugin: 'maven-publish'
publishing {
repositories {
// path to somewhere in my repo
maven { url new File(project.rootProject.getProjectDir().absoluteFile.parentFile, ".m2-repo") }
}
}
}
...但它只发布根项目。我试过从子项目中运行publish
;我收到了一条最新消息,但没有任何内容添加到磁盘上的repo中。
我正在使用4.0.1 GradeWrapper
答案 0 :(得分:0)
需要;
apply plugin: 'maven-publish'
publishing {
repositories {
// publish to a "local" repo that I can also consume or upload as I wish
maven { url new File(project.rootProject.getProjectDir().absoluteFile.parentFile, ".m2-repo") }
}
// really, really publish things
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}