본문 바로가기
Computer/Etc

mvn proxy 설정

by hexists 2015. 3. 7.

java 개발자가 아니라서...

mvn이 뭐하는 것인지도 찾아봐야 아는 1인.


elasticsearch plugin 설치를 위해 mvn을 사용해야 하는데...

방화벽 때문인지 잘 안됨... 연결시간 초과 이런 메시지가 뜬다.


proxy 설정이 안되서 그런 것으로 생각되어 mvn proxy 설정과 관련된 내용을 검색해봤다.


일단, mvn proxy 설정은 다음과 같이 하면 된다.


$ vi ~/.m2/settings.xml


<settings>

<proxies>

<proxy>

<id>http_proxy</id>

<active>true</active>

<protocol>http</protocol>

<host>your_host</host>

<port>your_port</port>

</proxy>

<proxy>

<id>http_proxy</id>

<active>true</active>

<protocol>https</protocol>

<host>your_host</host>

<port>your_port</port>

</proxy>

</proxies>

</settings>


이렇게 설정하고, 다시 mvn을 실행해보면 OK!


그리고, 한가지 더 방법이 있는데, 


$ mvn install -Dhttps.proxyHost=your_host -Dhttps.proxyPort=your_proxy -Dhttp.proxyHost=your_host -Dhttp.proxyPort=your_proxy


이렇게 하면, proxy가 설정된 mvn을 사용할 수 있다. 끝.


참고 : http://maven.apache.org/guides/mini/guide-proxies.html

참고 : http://dylankernel.tistory.com/19



'Computer > Etc' 카테고리의 다른 글

kadane's algorithm(maximum contiguous subarray)  (0) 2015.03.21
mvn 설치  (0) 2015.03.09
mongodb 설치 및 사용  (0) 2015.01.15
mysql 오류 해결 & 계정 생성  (0) 2015.01.13
3way handshaking  (0) 2015.01.11