2012-01-09 2 views
3

maven이 로컬 Nexus 저장소에서 아티팩트를 다운로드하도록 mex 환경을 설정하려고합니다. Maven과 Nexus가 설치된 컴퓨터는 보안상의 이유로 인터넷에 연결되어 있지 않습니다.인터넷 연결없이 오프라인 상태에서 Maven 및 Sonatype Nexus 실행

저는 인터넷 연결이 가능한 워크 스테이션에 비슷한 구성을 가지고 있습니다. 두 컴퓨터에 Maven과 Nexus를 설치했습니다. 나는 간단한 보안 서버의 "MVN 설치"를 실행하는 실행 한

<?xml version="1.0" encoding="UTF-8"?> 
<settings xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> 
    <mirrors> 
    <mirror> 
     <id>nexus</id> 
     <mirrorOf>*</mirrorOf> 
     <url>http://localhost:8081/nexus/content/groups/public</url> 
    </mirror> 
    </mirrors> 
    <proxies></proxies> 
    <servers></servers> 
    <pluginGroups></pluginGroups> 
    <profiles> 
    <profile> 
     <id>nexus</id> 
     <!--Enable snapshots for the built in central repo to direct --> 
     <!--all requests to nexus via the mirror --> 
     <repositories> 
     <repository> 
      <id>central</id> 
      <url>http://central</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </repository> 
     </repositories> 
     <pluginRepositories> 
     <pluginRepository> 
      <id>central</id> 
      <url>http://central</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </pluginRepository> 
     </pluginRepositories> 
    </profile> 
    </profiles> 
    <activeProfiles> 
    <activeProfile>nexus</activeProfile> 
    </activeProfiles> 
</settings> 

과 누락 된 의존성에 대해 불평 : 아래 그림과 같이 나 또한 ~ m2/Settings.XML이 내 지역 받는다는 설정 파일을 업데이트했습니다. 이것은 저장소에 아티팩트를 다운로드하고 업로드하지 않았기 때문에 예상됩니다.

내 로컬 워크 스테이션을 사용하여 이슈를 다운로드하고 압축 한 다음 보안 컴퓨터의 Nexus 리포지토리에 업로드하고 싶습니다. 내 로컬 워크 스테이션에 'mvn install'을 실행했고 모든 것이 다운로드되었습니다. 이제 로컬 워크 스테이션의 저장소를 보안 서버에 복사해야합니다.

Nexus 설명서에 따르면 $HOME/sonatype-work 폴더가 '저장 용량'위치입니다.

  • 이 폴더는 저장소를 복사하기 위해 보안 서버에 복사해야하는 유일한 폴더입니까?
  • 걱정할 필요가있는 파일이 있습니까? 예 : 구성 파일?
  • 기본적으로 Nexus는 원격 저장소를 사용 중지합니다. 이것은 내가 중앙 저장소에서 아무 것도 다운로드하지 못하도록 할 필요가 없다는 것을 의미합니다.

미리 감사드립니다.

답변

3

로컬 저장소의 콘텐츠를 Nexus 서버의 저장 영역에 업로드 할 수 있습니다. 리포지토리 메타 데이터 (Nexus GUI를 통해 호출 할 수있는 작업)의 색인을 다시 생성하거나 재생성해야 할 수도 있습니다.

그러나 .... 궁극적으로 유지 관리가 줄어드는 대안 솔루션을 고려하는 것이 좋습니다.

Nexus의 전문가 용 버전은 procurement suite 기능을 제공합니다.이 기능을 사용하면 콘텐츠가 규칙에 따라 제어되거나 참조 빌드를 기반으로 제어됩니다.

Nexus 만 인터넷에 액세스 할 수 있도록 방화벽을 엽니 다. 타사 Nexus 저장소에 대한 개발 제어 액세스 권한을 부여 할 수 있습니다.

+0

안녕하세요, 방화벽을 활성화하는 옵션은 프로젝트의 보안 성 때문에 사실상 불가능합니다. 감사. – ziggy

+0

다음 질문은 관련이 있습니다. http://stackoverflow.com/questions/4997219/disable-maven-central-repository/4997553#4997553 –

관련 문제