我想在我的项目(Android )中上传一个jar到JFrog Artifactory。我经历了几个环节,最后我做到了,
apply plugin : 'maven'
configurations {
resultArchives
}
uploadResultArchives {
repositories {
mavenDeployer {
repository(url: "http://artifactory/libs-release-local/")
{
authentication(userName: 'a', password: 'pass');
}
}
}}
artifacts{
resultArchives file: file('gradle/plugin-1.0.0.jar')
}
这是建设良好的格拉德尔,但我看到什么都没有上传。我是不是遗漏了什么?
发布于 2016-03-10 16:20:41
请使用Gradle Artifactory插件。它负责上传,并用构建元数据对工件进行注释。
JFrog GitHub回购包含了许多关于如何配置插件的示例。
发布于 2018-07-14 13:46:10
你需要插件:
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
要构建项目并从工件中检索jars:
buildscript {
repositories {
maven {
url 'http://IP_PORT/artifactory/gradle-dev'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
mavenCentral()
}
dependencies { classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.5.4" }
}
repositories {
mavenCentral()
mavenLocal()
}
阿提工厂吐露:
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = 'gradle-dev-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
defaults {
publications('mavenJava')
}
publishBuildInfo = true
publishArtifacts = true
publishPom = true
}
resolve {
repository {
repoKey = 'gradle-dev'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
以及出版方面:
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
gradle.properties
artifactory_user=publisher
artifactory_password=*****
artifactory_contextUrl=http://IP:PORT/artifactory
所以一切都很简单。如果你想上传你的罐子:
gradle artifactoryPublish
https://stackoverflow.com/questions/35908047
复制相似问题