이 기사는 주로 Maven 환경의 구성 및 아이디어 구성을 소개합니다. 그것은 당신과 공유됩니다. 세부 사항은 다음과 같습니다.
Maven 다운로드 : http://maven.apache.org/download.cgi
Maven Central Warehouse 주소 : http://search.maven.org
Maven 환경 변수를 구성하십시오
m2_home : d :/workspace/maven/apache-maven-3.0.5
경로 :;%m2_home%/bin;
CMD가 성공적이고 개방적인지 확인하십시오.
MVN -V
MVN Install은 프로젝트의 생성 된 구성 요소를 로컬 Maven 저장소에 설치합니다.
MVN 배포는 프로젝트의 생성 된 아티팩트를 원격 Maven 저장소에 배포하는 데 사용됩니다.
D :/> MVN 아키 타입 : 생성 : D : 디스크에서 Maven 표준 프로젝트 디렉토리 구조 빌드
2. settings.xml 파일 구성
2.0 로컬 리포지토리 위치를 수정하십시오
m2_home 디렉토리의 conf/settings.xml
<LocalRepository> d :/workspace/maven/stone </localrepository>
2.1 원격 저장소 구성 방법 (개인 서버) : (Nexus-2.0.4-1-Bundle)
<profiles> <profile> <id> nexus </id> <repositories> <!-원격 저장소 구성-> <repository> <id> nexus </id> <name> 중앙 저장소 </name> <url> http://127.0.1/nexus/content/public </url> </릴리스> <snapshots> <enabled> false </enabled> <! -----> </snapshots> </repository> </repository> </repository> </repository> <fluginRepository> <id> Nexus </id> <stal> 중앙 리포지토리 </name> <Url> http://127.0.0.1/nexus/content/groups/public </url> <releases> <enabled> true </enabled> </릴리스> <snapshots> <enabled> false </enabled> </snapshots> </pluginreatority> </profile> </profile> </profile> <ActiveProfiles> <!-원격 리포지토리 활성화-> <ctiveProfile> Nexus </activeProfile> </activeProfiles>
2.2 저장소의 이미지 다운로드를 구성 할 수도 있습니다.
<mirrors> <mirror> <!-구성 미러-> <id> nexus </id> <mirrorof>*</mirrorof> <url> http://127.0.0.1/nexus/content/groups/public </url> </mirrors>
3. pom.xml 파일 구성 종속성
<project 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/0.0.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> <modelversion> 4.0.0 </modelversion> <groupid> xu.feifei </groupid> <artifactid> feifei </artifactid> <parkaging> war </packaging> <0 <0 </version> <pelove </version> <Artifactid> junit </artifactid> <bersion> 3.8.1 </version> <copo> </scope> </spectency> <pectionement> <groupid> org.json </groupid> <artifactid> json </artifactid> </infection> </speendencies> <build> </project>
2. 아이디어 구성 Maven 관련 구성
.
Maven 프로젝트의 패키지 구조
Maven 자동 패킷 안내를 설정하십시오
위는이 기사의 모든 내용입니다. 모든 사람의 학습에 도움이되기를 바랍니다. 모든 사람이 wulin.com을 더 지원하기를 바랍니다.