1
我使用gradle构建android库并将其推送到远程maven存储库。有什么方法可以得到pom
和aar
文件,并将其复制到项目的根目录中?使用gradle复制构建工件
这里是发布到Maven(它在库项目build.gradle
)
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
repository(url: constants.snapshotUrl) {
authentication(userName: userName, password: password)
pom.groupId = constants.groupId
pom.artifactId = constants.libUIArtifactIdName
pom.version = constants.projectVersion
}
pom.whenConfigured { pom ->
pom.dependencies.forEach { dep ->
if (dep.getVersion() == "unspecified") {
dep.setGroupId(constants.groupId)
dep.setVersion(constants.projectVersion)
}
}
}
}
}
你使用'maven'插件吗?如果是这样,您会在'$ {project.buildDir}/poms'下找到生成的poms,并在工件中找到它们。从'install'任务配置。 – Opal
@Opal或者,也许,我可以用uploadArchives.doLast做到这一点? –
也许可以这样做。 – Opal