로 컬 maven 창고 구축 실전
1 로 컬 maven 구축
1.1 넥 서 스 를 다운로드 (http://www.sonatype.org/nexus/archived/)
1.2 압축 을 풀 고 / Library / nexus - 2.14.2 - 01
1.3 설정 수정
Nexus 의 설치 디 렉 터 리 에서 / bin / nexus 를 찾 으 면 수정
NEXUS_HOME
과 RUN_AS_USER
두 개의 인 자 는 다음 과 같 습 니 다.NEXUS_HOME="/Library/nexus-2.14.2-01"
# If specified, the Wrapper will be run as the specified user.
# IMPORTANT - Make sure that the user has the required privileges to write into the Nexus installation directory.
# NOTE - This will set the user which is used to run the Wrapper as well as
# the JVM and is not useful in situations where a privileged resource or
# port needs to be allocated prior to the user being changed.
RUN_AS_USER=root
# Application
APP_NAME="nexus"
APP_LONG_NAME="Nexus OSS"
2. 서비스 시작
2.1 sudo su (비밀 번 호 를 입력 하면 루트 사용자 로 전환)
2.2 /Library/nexus-2.14.2-01/bin/nexus start
2.3 브 라 우 저 사용, 열기http://localhost:8081/nexus/
3. 구조물 을 Maven 창고 에 업로드
apply plugin: 'maven'
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://localhost:8081/nexus/content/repositories/android/") {
authentication(userName: "admin", password: "admin123")
}
pom.version = "1.0"
pom.artifactId = "deskcore"
pom.groupId = "com.le"
}
}
}
4 사용 부재
프로젝트 의 루트 디 렉 터 리 gradle. build 파일 에 로 컬 meaven 창 고 를 추가 합 니 다.
buildscript {
repositories {
jcenter()
maven {
credentials {
username 'admin'
password 'admin123'
}
url 'http://localhost:8081/nexus/content/repositories/android/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
구체 적 인 module 의 gradle. build 파일 에 의존 도 를 추가 합 니 다.
dependencies {
compile 'com.le:ucenter-core:1.0'
}
참고 문헌
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Kotlin의 기초 - 2부지난 글에서는 Kotlin이 무엇인지, Kotlin의 특징, Kotlin에서 변수 및 데이터 유형을 선언하는 방법과 같은 Kotlin의 기본 개념에 대해 배웠습니다. 유형 변환은 데이터 변수의 한 유형을 다른 데이터...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.