我正在使用jfrog artifactory发布一个android库。图书馆出版得很好。但是当我尝试使用它时,库的gradle依赖项没有加载。
我的pom.xml已经有了这些依赖项。
我的库有两个模块-
-app
-secondarymod
这是我在主项目级build.gradle中的代码-
artifactoryPublish.skip = true
project('app') {
artifactoryPublish.dependsOn('build')
publishing {
publications {
aar(MavenPublication) {
groupId = "in.mikkel.mainapp"
artifactId = project.getName()
version = "1.0.24"
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
pom.withXml {
def dependencies = asNode().appendNode("dependencies")
configurations.implementation.allDependencies.each {
def dependency = dependencies.appendNode("dependency")
print(it.group)
dependency.appendNode("groupId", it.group)
dependency.appendNode("artifactId", it.name)
dependency.appendNode("version", it.version)
}
}
}
}
}
artifactoryPublish {
publications(publishing.publications.aar)
}
}
project('secondarymod') {
artifactoryPublish.dependsOn('build')
publishing {
publications {
aar(MavenPublication) {
groupId = "in.mikkel.mainapp"
artifactId = project.getName()
version = "1.0.24"
// Tell maven to prepare the generated "*.aar" file for publishing
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
pom.withXml {
def dependencies = asNode().appendNode("dependencies")
configurations.implementation.allDependencies.each {
def dependency = dependencies.appendNode("dependency")
print(it.group)
dependency.appendNode("groupId", it.group)
dependency.appendNode("artifactId", it.name)
dependency.appendNode("version", it.version)
}
}
}
}
}
artifactoryPublish {
publications(publishing.publications.aar)
}
}
artifactory {
contextUrl = 'https://mikkel.jfrog.io/artifactory'
publish {
repository {
repoKey = 'mikkelcl-gradle-release-local'
username = "***"
password = "***"
}
defaults {
publications('aar')
publishArtifacts = true
publishPom = true
}
}
}
谁能告诉我怎么了?
1条答案
按热度按时间svmlkihl1#
一般来说,在包管理器的世界中,依赖关系永远不会发布。只有人工制品能做到这一点。依赖项应以与在本地计算机中下载依赖项相同的方式下载到ci中。
如果依赖项是您的私有代码,则应分别构建和发布它们。
否则,您应该在服务器上配置依赖项存储库
build.gradle
文件在这种情况下,请确保在中配置了存储库repositories
条款阅读更多关于在gradle中声明存储库的信息。