2014-12-29 3 views
4

I 'm stuck with integrating artifactory 3.0.1 플러그인과 Gradle. 저는 Android Studio 1.0을 사용하고 있으므로 Gradle 2.0에 있다고 추측합니다. 3.0.1 플러그인을 사용하여 artifactory에 게시하는 예는 매우 유용합니다. 사전artifactory에 Android aar 게시

답변

0

JFrog에서

덕분에 Artifactory하는 AAR을 게시의 모든 기능을 예를 게시합니다. Here you go. 함께 작업하는 플러그인의 버전을 선택하고 예제를 찾으십시오.

+2

예 나는 그것을 시도하고 그것은 오래된 플러그인 (2.3)이 아니라 3.0.1 위대한 작품 : 당신은 GitHub의에 태그를 누르면 태그, 당신은 트래비스에 vX.X.X 태그를 구축하고 있는지 확인 – Jani

+0

살펴보기로하겠습니다. – JBaruch

+1

플러그인을 구성 할 수 있었지만 지금은 게시가 작동하는 것 같습니다. 그러나 나는 gradle을 통해 발행 된 이슈를 해결할 수 없습니다. 받는다는 { URL에 "http : // localhost를 : 8081/artifactory/Gradle을" 자격 증명 { 사용자 이름 = '관리자' 암호 = '암호' } }. 어떤 생각? – Jani

0

Artifactory로 게시하는 것은 구성 작업에 불과합니다. 두 개의 플러그인 (com.jfrog.artifactorymaven-publish)을 구성하고 artifactoryPublish Gradle의 작업을 실행하기 만하면됩니다. 당신을 업로드하려면, 또한 ./gradlew artifactoryPublish

을 실행 한 후

 
apply plugin: 'com.jfrog.artifactory' 
apply plugin: 'maven-publish' 

publishing { 
    publications { 
     aar(MavenPublication) { 
      groupId 'com.fewlaps.something' //put here your groupId 
      artifactId 'productname' //put here your artifactId 
      version '7.42.0' //put here your library version 

      // Tell maven to prepare the generated "*.aar" file for publishing 
      artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") 
     } 
    } 
} 

artifactory { 
    contextUrl = 'https://your-artifactory-host.com/artifactory' 
    publish { 
     repository { 
      repoKey = "libs-release-local" 
      username = "username" 
      password = "password" 
     } 
     defaults { 
      // Tell the Artifactory Plugin which artifacts should be published to Artifactory. 
      publications('aar') 
     } 
    } 
} 

그리고 : 라이브러리의 build.gradle에 ·)

:하지만 ... 이제, 코드에 의해 그것을 설명 copypasting을 완화하자 그것을 위해 빌드를 실행되지 않을 경우 당신은 GitHub의에 태그를 밀어 유물마다, 당신의 .travis.yml

 
deploy: 
    - provider: script 
    script: ./gradlew artifactoryPublish 
    skip_cleanup: true 
    on: 
     tags: true 

이 코드를 추가

 
# Build only master and "vX.X.X" tags to prevent flooding Travis machines 
branches: 
    only: 
    - master 
    - /^v\d+\.\d+\.\d+$/ 
관련 문제