gpt4 book ai didi

gradle - 无法使用 Gradle 在 Artifactory 上部署 Artifactory

转载 作者:行者123 更新时间:2023-12-01 06:27:06 24 4
gpt4 key购买 nike

我想在 Artifactory 上部署我的 Java 库 Artifactory ,但出现以下错误。
部署文件失败:HTTP 响应代码:401。HTTP 响应消息:未经授权。

我跟着指南gradle artifactory plugin

下面是我的 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
}
}
}

谁能指导我哪里出错了?

最佳答案

当 ~/.m2/settings.xml 或 $GRADLE_USER_HOME/gradle.properties 损坏时可能会发生这种情况。明确使用加密密码进行 Artifactory 访问时。尝试重新生成它。

关于gradle - 无法使用 Gradle 在 Artifactory 上部署 Artifactory ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27143448/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com