Eclipse용 Maven settings.xml 파일이 누락되었습니까? 업무용 및 개인용 작업 공간에 두 개의 settings.xml 파일이 필요한 경우 어떻게 하시겠습니까?
게시 됨: 2018-02-19 개발자 워크스테이션에서 여러 Eclipse 환경을 실행하고 있습니까? 아니면 노트북에서? 그렇다. different custom maven
설정이 서로 two different Eclipse workspace
이 있는 시나리오를 고려해 보겠습니다.
왜 그런가? 이해하자.
-
Work
개발 환경 또는 프레임워크가 Eclipse를 기반으로 하는 경우 어떻게 됩니까? 회사 환경에서 필요한 모든 프로젝트의 .jar 파일은private
저장소에 있어야 하며 매우 구체적인 저장소가 포함된 사용자 지정settings.xml
파일이 있어야 합니다. - 그리고 반대 측면에서 표준 eclipse/maven 사용의 경우 모든
public
maven 리포지토리를 제한 없이 무료로 사용할 수 있습니다.
확실히 위의 사용법에는 두 개의 서로 다른 settings.xml
파일이 필요합니다. maven 및 eclipse 설정을 처음 사용하는 경우 다음 단계에 따라 랩톱/데스크톱에서 maven을 올바른 방법으로 설정하십시오.
NOTE:
Eclipse에서 settings.xml을 추가하는 방법은 무엇입니까? 기본 설정을 변경하지 않으려면 settings.xml이 필요하지 않습니다(따라서~/.m2
폴더에 자동 생성되지 않음). 우리의 경우work
및personal
작업 공간에 대해 다른 설정이 있습니다.
아래 질문이 있는 경우 올바른 위치에 있습니다.
- eclipse – maven settings.xml 파일이 없는 이유는 무엇입니까?
- Eclipse에서 내 settings.xml 파일에 어떻게 연결합니까?
- Eclipse 및 Maven을 사용한 개발 프로젝트
- m2e 사용자 – settings.xml 파일은 어디에 있습니까?
- maven settings.xml 파일 다운로드
- 이클립스 임베디드 메이븐
- 이클립스 메이븐 settings.xml 위치
settings.xml 파일이란?
settings.xml
은 maven 프로젝트의 pom.xml 파일에서 내부적으로 참조하는 maven
에 대한 모든 구성을 제공하는 파일입니다. pom.xml
파일에 종속성을 추가하면 maven은 내부적으로 필요한 .jar 파일을 다운로드하여 settings.xml 파일에 언급된 폴더 아래에 넣습니다.
settings.xml 파일은 어디에서 찾을 수 있습니까?
- Windows 시스템: C:\Users\ashah\.m2\settings.xml
- Mac OS X: /home/ashah/.m2/settings.xml
settings.xml 파일의 기본 내용은 무엇입니까?
시스템 사용자 이름으로 아래 파일의 <UserName>
을 업데이트하기만 하면 됩니다. 다음은 maven settings.xml 다운로드 파일 입니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
<? xml version = "1.0" encoding = "UTF-8" ?> < ! -- | This is the configuration file for Maven . It can be specified at two levels : | | 1. User Level . This settings . xml file provides configuration for a single user , | and is normally provided in $ { user . home } / . m2 / settings . xml . | | NOTE : This location can be overridden with the CLI option : | | - s / path / to / user / settings . xml | | 2. Global Level . This settings . xml file provides configuration for all Maven | users on a machine ( assuming they 're all using the same Maven | installation). It' s normally provided in | $ { maven . home } / conf / settings . xml . | | NOTE : This location can be overridden with the CLI option : | | - gs / path / to / global / settings . xml | | | -- > < settings xmlns = "http://maven.apache.org/SETTINGS/1.0.0" xmlns : xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation = "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" > < ! -- Change username in below line -- > < localRepository > / Users / ashah / . m2 / repository < / localRepository > < interactiveMode > true < / interactiveMode > < offline > false < / offline > < pluginGroups > < ! -- pluginGroup | Specifies a further group identifier to use for plugin lookup . < pluginGroup > com . your . plugins < / pluginGroup > -- > < / pluginGroups > < proxies > < ! -- < proxy > < id > optional < / id > < active > true < / active > < protocol > http < / protocol > < username > proxyuser < / username > < password > proxypass < / password > < host > proxy . host . net < / host > < port > 80 < / port > < nonProxyHosts > local . net | some . host . com < / nonProxyHosts > < / proxy > -- > < / proxies > < servers > < ! -- < server > < id > deploymentRepo < / id > < username > crunchify < / username > < password > crunchify < / password > < / server > -- > < / servers > < mirrors > < ! -- < mirror > < id > mirrorId < / id > < mirrorOf > repositoryId < / mirrorOf > < name > mirror description < / name > < url > http : //my.repository.com/repo/path</url> < / mirror > -- > < / mirrors > < profiles > < / profiles > < / settings > |
위는 maven eclipse용 샘플 settings.xml입니다.

개인 및 업무 관련 저장소에 두 개의 다른 settings.xml 파일을 사용하려면 어떻게 해야 합니까?
1 단계
-
~/.m2
폴더로 이동 - 작업 관련
settings.xml
파일을 넣고localRepository
경로를 제공합니다. - <localRepository>/Users/<UserName>/.m2/
work
</localRepository>
2 단계
-
~/.m2
폴더로 이동 - 로컬 이클립스 관련
crunchify-settings.xml
파일을 넣고localRepository
경로를 제공합니다. - <localRepository>/Users/<사용자 이름>/.m2/
repository
</localRepository>
settings.xml 파일이 정확하지 않은 이유는 무엇입니까?
Eclipse는 다음과 같은 다양한 오류를 발생시킵니다.
올바른 settings.xml 파일이 있으면. 아래 단계를 수행하면 모든 오류가 사라집니다.
-
Project
메뉴 클릭 -
Clean...
을 클릭하고 프로젝트를 정리합니다. - 프로젝트를 마우스 오른쪽 버튼으로 클릭
-
Maven
클릭 -
Update Project...
(다이어그램 아래)를 클릭합니다.
그게 다야 위의 단계를 수행한 후 Eclipse는 settings.xml 파일에 제공된 경로에서 모든 프로젝트 종속성을 가져옵니다. 가져오기 프로세스가 완료된 후 Eclipse에서 컴파일 문제가 표시되지 않아야 합니다. 프로젝트 종속성과 인터넷 다운로드 속도에 따라 종속성 가져오기 프로세스는 5분에서 30분 사이가 소요될 수 있습니다.