2011-05-09 5 views
0

Maven 3.0.3을 사용하고 있습니다. 분명히 Oracle JDBC 드라이버는 공용 Maven 저장소에서 사용할 수 없기 때문에 로컬 로컬 드라이버 드라이버에 설치하는 것으로 축소되었습니다. 그래서 받는다는 실행시 그러나이 파일이 JAR을 로컬 저장소에 저장하는 올바른 방법은 무엇입니까?

~/.m2/repository/oracle/oracle/10.2.0.3.0/classes12.jar 

내 pom.xml 파일이이 ...

<dependency> 
    <groupId>oracle</groupId> 
    <artifactId>classes12</artifactId> 
    <version>10.2.0.3.0</version> 
</dependency> 

를 만들어,이 오류를 받고 있어요. 로컬 저장소를 어떻게 구성합니까? - 모두의 데이브

[ERROR] Failed to execute goal on project infinitiusa_leads_testing: Could not resolve dependencies for project infinitiusa_leads_testing:infinitiusa_leads_testing:jar:1.0-SNAPSHOT: Failure to find oracle:classes12:jar:10.2.0.3.0 in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [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 

답변

2

첫째, 당신은 저장소에서 파일을 설치해야합니다 오른쪽 디렉토리에 복사 아닙니다. 답변보기 : Find Oracle JDBC driver in Maven repository.

둘째, 디렉토리가 실제로 올바르지 않습니다. 당신의 pom.xml에서 제공하는 의존성이의 거짓말을해야합니다

~/.m2/repository/oracle/classes12/10.2.0.3.0/classes12-10.2.0.3.0.jar 

을하지만이 몇 가지 물건을 삭제 제외 (수동 저장소 디렉토리를 조작하지 마십시오 install:install-file에 의해 처리되고, Maven은 때때로 혼란과 도착 이 다시 시작하려면이 필요하지만 다른 내용입니다.)

mvn install:install-file -DgroupId=oracle -DartifactId=classes12 \ 
-Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=classes12.jar 

BTW groupId으로 com.oracle을 고려한다.

또한 maven은 로컬 저장소에 누락 된 종속성을 설치하기 위해 실행해야하는 매우 정확한 명령 줄을 제공합니다. 당신의 사건에서 왜 그렇게되지 않았는지 모르겠다.

+0

groupId의 이름 지정에 대한 +1 :-) – Jan

관련 문제