2013-07-23 1 views
2

maven2 명령 줄 인터페이스를 사용하여 json-simple 라이브러리의 소스 코드를 다운로드하려고합니다. 그래서, 관련 SO 질문의 대답은 사용 후/pom.xml 파일Paven.xml을 사용하여 Maven 다운로드 소스 코드 명령 행

http://json-simple.googlecode.com/svn/trunk/pom.xml

와 ~/프로젝트에이 .pom 파일을 다운로드 : How to install Maven artifact with sources from command line?를, 나는, 다음 명령을 사용하여 소스 코드를 다운로드하려고

$ cd ~/project 
$ mvn eclipse:eclipse -DdownloadSources=true 
$ ls 

출력은 pom.xml뿐입니다. 뭐가 잘못 되었 니?

$ mvn --version 

아파치 메이븐 2.2.1 (rdebian-8)

답변

5

사용 dependency 플러그인의 get 목표

전체 명령 줄 (어딘가에 실행 - 당신은 치어 필요하지 않습니다)

mvn -DgroupId=com.googlecode.json-simple 
    -DartifactId=json-simple 
    -Dversion=1.1.1 
    -Dclassifier=sources 
    -DremoteRepositories=http://nexus.dmz1.heuboe.hbintern:8080/nexus/content/repositories/central/ 
    org.apache.maven.plugins:maven-dependency-plugin:2.8:get 

또는 oneliner으로

mvn -DgroupId=com.googlecode.json-simple -DartifactId=json-simple -Dversion=1.1.1 -Dclassifier=sources -DremoteRepositories=http://nexus.dmz1.heuboe.hbintern:8080/nexus/content/repositories/central/ org.apache.maven.plugins:maven-dependency-plugin:2.8:get 

일반적으로 Maven 3을 사용하고 있지만 Windows의 Maven 2.2.1에서도이를 테스트했으며 작동합니다.

maven-eclipse-plugin (eclipse : eclipse) 대신Maven 통합을 eclipse (이클립스 마켓 플레이스에서 아직 설치하지 않은 경우이를 확인하십시오)에서 사용할 수도 있습니다. 당신은 소스를 다운로드하는 Eclipse 환경 설정 옵션이 있습니다.

+0

빌드가 실패했습니다. 빌드 단계를 수행하려면 하나 이상의 목표 또는 수명주기 단계를 지정해야합니다. – Sait

+0

@celebisait 가능하면 한 줄로 정확하게 복사되지 않았습니다. 내가 추가 한 oneliner를 가져 가라. – FrVaBe

+0

아직 문제가 있습니다. 한 줄의 명령을 사용했을 때 다음과 같은 결과를 얻습니다 :'프로젝트 검색 중 ... Maven 기본 프로젝트 태스크 세그먼트 만들기 : [org.apache.maven.plugins : maven-dependency-plugin : 2.8 : get] (aggregator- 스타일 : dependency : get {execution : default-cli}) com.googlecode.json-simple : json-simple : jar : sources : 1.1.1 이행 의존성을 가진 해결 성공 BULLD SUCCESSFUL'. 그러나 소스 코드를 찾을 수 없습니다. 아무것도 다운로드 중이 아닙니다. – Sait