2017-01-03 1 views

답변

1

첫째, 당신이이 일을 수행하는 방법에 대한 호기심이 있다면, 당신은 넥서스 저장소 2 REST API를 학습하는 방법에 대한 Sonatype에서 우리가이 문서를 사용할 수 있습니다 둘째 http://www.sonatype.org/nexus/2015/01/26/learn-the-nexus-rest-api-automating-sonatype-nexus/

을, 여기의 예 하나 우리 내부 팀 구성원이 다음과 같이 나타났습니다.

http://localhost:8081/nexus/service/local/repositories에 대한 POST 요청입니다. 당신은 컬과 같이 사용할 수 있습니다 :

컬 -H "내용 - 형식 : 응용 프로그램/JSON"-d @ repo.json -u 관리자 : admin123과를 http://localhost:8081/nexus/service/local/repositories

는 여기에 "REPO에 대한 몇 가지 예제 내용입니다. json "파일을 참조하라.이 파일은 프록시 Maven 저장소를 생성하는 방법을 보여준다. 다른 유형의 저장소를 생성하기위한 페이로드가 다르기 때문에 위의 문서를 사용하여 해당 저장소의 유형을 확인하십시오.

{ 
    "data": { 
     "repoType": "proxy", 
     "id": "somerepo", 
     "name": "Some Repo Name", 
     "browseable": true, 
     "indexable": true, 
     "notFoundCacheTTL": 1440, 
     "artifactMaxAge": -1, 
     "metadataMaxAge": 1440, 
     "itemMaxAge": 1440, 
     "repoPolicy": "RELEASE", 
     "provider": "maven2", 
     "providerRole": "org.sonatype.nexus.proxy.repository.Repository", 
     "downloadRemoteIndexes": true, 
     "autoBlockActive": true, 
     "fileTypeValidation": true, 
     "exposed": true, 
     "checksumPolicy": "WARN", 
     "remoteStorage": { 
      "remoteStorageUrl": "http://someplace.com/repo", 
      "authentication": null, 
      "connectionSettings": null 
     } 
    } 
} 
관련 문제