我是Gradle和Artifactory的新手,我想将一个JAR文件上传到Artifactory.
这是我的build.gradle
档案:
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'artifactory-publish'
groupId = 'myGroup'
version = '1.0'
def artifactId = projectDir.name
def versionNumber = version
artifactory {
contextUrl = 'http://path.to.artifactory' // base artifactory url
publish {
repository {
repoKey = 'libs-releases' // Artifactory repository key to publish to
username = 'publisher' // publisher user name
password = '********' // publisher password
maven = true
}
}
}
artifactoryPublish {
dependsOn jar
}
Run Code Online (Sandbox Code Playgroud)
运行artifactoryPublish
任务后,构建成功,如下所示: …