2014-11-26 3 views
4

Artifactory에 Java 라이브러리 아티팩트를 배포하고 싶습니다만 다음 오류가 발생합니다. 파일 배포 실패 : HTTP 응답 코드 : 401. HTTP 응답 메시지 : Unauthorized.Gradle을 사용하여 Artifactory에 이슈를 배치하지 못했습니다.

내가 가이드 아래 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 
     } 
    } 
} 

사람이 나를 인도 할 수있는 내가 잘못 갈거야?

+0

artifactory에 대한 로그를 확인할 수있는 기회가 주어집니다. 실패 이유를 더 잘 알 수 있습니다. – roomsg

+0

흠집, 스냅 샷 아티팩트 ("x.y.z-SNAPSHOT")를 릴리스 리포지토리에 게시하려고합니다. 기본적으로 artifactory는 이것을 허용하지 않습니다. 나는 artifactory에 대한 로그가 당신에게 똑같이 말할 것이라고 생각합니다. – roomsg

+0

또는 게시 할 수는 있지만 이전 배포를 덮어 쓸 수있는 권한이 없습니다 (삭제) 권한이 있습니다. 그리고 다른 설명이있는 것 같습니다. – roomsg

답변

0

~/.m2/settings.xml 또는 $ GRADLE_USER_HOME/gradle.properties가 손상 될 때 발생할 수 있습니다. Artifactory 액세스에 대해 암호화 된 암호를 사용하는 경우 명시 적으로. 다시 재생성하십시오.

관련 문제