이번 포스트에서는 sonatype Nexus를 세팅해봅시다.
기존의 프로세스는 jcenter -> 개발PC에 다운로드 -> 빌드시에 사용 입니다..
우리가 할려는 대략적인 구조는 다음과 같습니다.
jcenter -> Local Repository -> 개발PC에 다운로드 -> 빌드시에 사용.
( 패키지를 찾아서 일일이 Local에 등록시켜 놓는것도 보통일이 아니기에… -_- )
우선 Nexus에 로그인합니다. 그러면 다음과 같이 메뉴가 나타납니다. Repositores를 클릭합니다.
그런다음 Add를 클릭하여 Proxy Repository를 클릭합니다.
이름은 마음에드는 “아무거나”로 하시고 다음과 같이 세팅합니다.
그럼 세팅이 완료 되었습니다.
여기서 중요한 것은 생성된 repository의 주소입니다. 나중에 이 주소가 Android 빌드시에 사용되게 됩니다.
다시 Android 프로젝트로 돌아와서….
Build.gradle(Project:아무거나) 파일을 열어주세요. 그리고 앞에서 생성한 repository 주소를
다음과 같이 편집해주세요.
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { /* repositories { jcenter() } */ repositories { maven { url "http://repo.teracle.com:8081/nexus/content/repositories/trproxy/" } } dependencies { classpath 'com.android.tools.build:gradle:1.0.0' classpath 'com.google.gms:google-services:1.3.0-beta1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { /* repositories { jcenter() } */ repositories { maven { url "http://repo.teracle.com:8081/nexus/content/repositories/trproxy/" } } }
이 파일을 편집하게 되면 편집툴 상단에 Sync Now 라는 링크가 표시됩니다. 수정이 완료되면
클릭해주세요.
빌드시에 사용했던 패키지들이 Local Repository에 넘어와 있는 것을 확인할 수 있어요!
끗 -ㅅ-)