2012-06-08 5 views
2

나는 설치 사용받는다는 설치 플러그인이 : 설치 파일 오류

<plugin> 
<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-install-plugin</artifactId> 
<version>2.3.1</version> 
<executions> 
    <execution> 
    <id>install-paho</id> 
    <phase>generate-resources</phase> 
    <goals> 
     <goal>install-file</goal> 
    </goals> 
    <configuration> 
     <file>${basedir}/lib/paho.jar</file> 
     <groupId>org.eclipse</groupId> 
     <artifactId>paho</artifactId> 
     <version>1.0.0</version> 
     <packaging>jar</packaging> 
    </configuration> 
    </execution> 
</executions> 
</plugin> 

당신은 내가 그것을 결합 것을 찾을 수 있습니다 내 로컬 repository.My의 pom.xml 파일에 항아리를 설치 - 설치 파일을 다음과 같이 기록 단계는 '나는 순서 .IT는 아주 잘 작동 mvn eclipse:eclipse 사용 후-resources'.And를 생성하고 난 오류가있어 순서 mvn install:install-file를 사용할 때 단지 내 로컬 repository.But에 복사되었습니다

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file (default-cli) on project xxx: 
The parameters 'file' for goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file are missing or invalid -> [Help 1] 

오류 메시지를 사용시 mvn compile

[ERROR] Failed to execute goal on project android-engine: Could not resolve dependencies for project com.youku.wireless:android-engine:jar:1.0-SNAPSHOT: Could not find artifact org.eclipse:paho:jar:1.0.0 in spring-milestone (http://maven.springframework.org/milestone) -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1]  http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException 

답변

7

당신이 generate-sources 단계로 install:install-file 목표를 결합했기 때문에, 당신은 mvn compile 또는 mvn install 또는 정의 된 구성을 사용하여 실행해야합니다.

mvn eclipse:eclipse은 maven이 eclipse:eclipse을 호출하기 전에 generate-sources 단계를 실행하기 때문에 작동합니다.

편집 : 먼저 generate-sources 단계에서 해당 지역의 repo에 설치하여 프로젝트 paho.jar 로컬로 사용할 수를 사용하고 그 이후 프로젝트에 dependency로 사용하려는 것 같습니다 코멘트에서.

수명주기 목표를 실행하기 전에 maven에서 dependencies의 가용성을 확인하기 때문에이 방법은 작동하지 않습니다.

mvn install:install-file을 사용하여 수동으로 한 번만 설치할 수 있습니다. 더 나은 여전히 ​​repository manager에 배포하고 다른 종속성처럼 액세스 할 수 있습니다.

그러나 여전히이 경로를 사용하려는 경우 대체 방법은 system 범위의 종속성을 지정하여 jar 경로를 제공하는 것입니다. this을 참조하십시오.

<project> 
    ... 
    <dependencies> 
    <dependency> 
     <groupId>org.eclipse</groupId> 
     <artifactId>paho</artifactId> 
     <version>1.0.0/version> 
     <scope>system</scope> 
     <systemPath>${basedir}/lib/paho.jar</systemPath> 
    </dependency> 
    </dependencies> 
    ... 
</project> 
+0

나는 이해할 수 없다. 나는 'mvn compile'을 실행하지만 여전히 오류가있다. 나는 무엇인가 놓친다? – plucury

+0

@ plucury. 'mvn compile'을 실행할 때 질문을 편집하고 maven 출력을 게시 할 수 있습니까? – Raghuram

+0

@Raghurm 나는 이미 게시물을 편집했습니다. 도움을 청합니다. – plucury