我想在Artifactory上部署我的Java库,但是我遇到了以下错误。
无法部署文件:HTTP响应代码:401。HTTP响应消息:未经授权。
我按照指南gradle artifactory插件进行操作。
下面是我的build.gradle文件。
下面是我的build.gradle文件。
apply plugin: 'java'
apply plugin: 'eclipse'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: "com.squareup.retrofit", name: "retrofit", version: "1.7.0"
compile group: "com.squareup.okhttp", name: "okhttp", version: "2.0.0"
compile group: "com.squareup.okhttp", name: "okhttp-urlconnection", version: "2.0.0"
}
version = '1.0.0-SNAPSHOT'
group = 'com.xyz'
buildscript {
repositories {
maven {
url 'http://localhost:8081/artifactory/libs-release'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
name = "maven-main-cache"
}
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.0.1')
}
}
apply plugin: 'maven-publish'
repositories {
add buildscript.repositories.getByName("maven-main-cache")
}
allprojects {
apply plugin: 'com.jfrog.artifactory'
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'libs-snapshot-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
defaults {
publications ('mavenJava')
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
有人能指导我错在哪里吗?