본문 바로가기
카테고리 없음

Nexus Maven Repository 오프라인 설정

by 프로파이 2023. 5. 4.
반응형

 

1. Nexus 다운로드 

 

- Nexus 홈페이지에서 다운로드하기

 

Sonatype Nexus Repository Manager Pro Free Trial | Sonatype

Try a free trial of the world’s most popular repository manager with universal component format support.

www.sonatype.com

 

-  전자정부 프레임워크에서 다운로드하기 

 

개발환경 - 3.x 다운로드 | 표준프레임워크 포털 eGovFrame

처리중입니다. 잠시만 기다려주십시오.

www.egovframe.go.kr

전자정부 프레임워크를 사용하면 전자정부 홈페이지에서 다운로드할 수 있다. 전자정부 홈페이지에 들어가 원하는 버전의 서버용 개발환경 다운로드를 클릭하면 eGovCI 파일을 다운로드할 수 있다.

 

 

 

2. Nexus 서버 구동 

 

압축 해제 후 start-nexus라는 windows 배치 파일을 관리자 권한으로 실행해 주자. 

 

 

3. Nexus Repository Maven 설정  

 

http://127.0.0.1:8081/nexus/

초기 아이디  :  admin

초기 비밀번호 :  admin123

 

nexus repository 설정
Nexus Repository

- Nexus Maven 라이브러리 설정 

Central repositoryconfiguration -> remote repository access -> download remote indexes false -> true로 변경 후 save 버튼 클릭

 

 

 

4. Eclipse 설정

외부망에서 Nexus 설치와 구동이 끝났으면 이제 내부망(폐쇄망) 환경에서 개발툴의 maven 설정만 해주면 된다. 

 

- settings.xml 설정

 

<mirror>
       <id>nexus</id>
       <mirrorOf>*</mirrorOf>
        <name>Local nexus repository</name>
       <url>http://xxx.xxx.x.xxx:8081/nexus/content/groups/public</url>
</mirror>

 

 

- 프로젝트의 pom.xml 설정 

 

<repositories>

<repository>
<id>public</id>
<url>http://xxx.xxx.x.xxx:8081/nexus/content/groups/public</url>   //nexus가 구동중인 외부망 주소
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository> 

 

<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://xxx.xxx.x.xxx:8081/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

 

 

 

 

※ 위 설정으로도 안된다면 방화벽 포트 확인이나 Preferences -> maven의 offline모드가 체크 해제 되어 있는지 확인해봐야 한다. maven의 offline모드가 체크되어 있다면 인터넷 연결이 불가능해 당연히 못 가져온다.

반응형

댓글