2014-10-17 3 views
1

이 Maven 오류로 인해 완전히 도움이되지 않아 도움이 될 수 있습니다. 내가 부모 프로젝트에 가서 할 경우종속성 오류가 발생하는 프로젝트 내 Maven 리포지토리

<parent> 
    <groupId>ca.gc.agr.common</groupId> 
    <artifactId>common-web-parent</artifactId> 
    <relativePath>../DryDockWebPOM/pom.xml</relativePath> 
</parent> 
<artifactId>CognosReportWeb</artifactId> 
<packaging>jar</packaging> 
<version>2.0</version> 

<name>CognosReportWeb</name> 

<dependencies> 

    ... stuff .... 

    <dependency> 
     <groupId>ca.gc.agr.common</groupId> 
     <artifactId>CognosReportService</artifactId>  
     <version>[1.0,)</version> 
    </dependency> 

    ... stuff .... 

</dependencies> 

: 그래서 같은이 하나를 사용하는 다른 프로젝트가있다

<parent> 
    <groupId>ca.gc.agr.common</groupId> 
    <artifactId>drydock-parent</artifactId> 
    <relativePath>../DryDockPOM/pom.xml</relativePath> 
</parent> 
<artifactId>CognosReportService</artifactId> 
<packaging>jar</packaging> 
<version>2.0</version> 

<name>CognosReportService</name> 

<!-- In Project repository --> 
<repositories> 
    <repository> 
     <id>in-project</id> 
     <name>In Project Repo</name> 
     <url>file://${project.basedir}/libs</url> 
    </repository> 
</repositories> 

<dependencies> 
    ... stuff ... 

    <dependency> 
     <groupId>cognos-sdk</groupId> 
     <artifactId>cognos-client</artifactId> 
     <version>8.4.1</version> 
    </dependency> 

    <dependency> 
     <groupId>cognos-sdk</groupId> 
     <artifactId>cognos-axis</artifactId> 
     <version>8.4.1</version> 
    </dependency> 

    ... stuff ... 

</dependencies> 

: 나는이 같은에서 프로젝트 REPO를 선언하는 프로젝트가 a mvn install 거기에서 모든 것이 작동합니다. 나는 그 자체로 CognosReportWeb를 구축하려고한다면, 나는이 얻을 : 첫 눈에

[ERROR] Failed to execute goal on project CognosReportWeb: Could not resolve dependencies for project ca.gc.agr.common:CognosReportWeb:jar:2.0: 
Failed to collect dependencies for [ca.gc.agr.common:CognosReportService:jar:[1.0,) (compile), 
ca.gc.agr.common:CommonWebJar:jar:[1.0,) (compile), 
org.apache.tomcat:tomcat-servlet-api:jar:7.0.16 (provided), 
javax.servlet.jsp:jsp-api:jar:2.2 (provided), 
javax.el:el-api:jar:2.2 (provided), 
org.glassfish.web:el-impl:jar:2.2 (provided), 
com.sun.faces:jsf-api:jar:2.1.7 (compile), 
com.sun.faces:jsf-impl:jar:2.1.7 (compile), 
org.apache.myfaces.tomahawk:tomahawk20:jar:1.1.10 (compile), 
org.richfaces:richfaces-bom:pom:4.2.0.Final (compile), 
org.richfaces.ui:richfaces-components-ui:jar:4.2.0.Final (compile), 
org.richfaces.core:richfaces-core-impl:jar:4.2.0.Final (compile), 
org.primefaces:primefaces:jar:5.0 (compile), 
org.springframework:spring-web:jar:4.0.0.RELEASE (compile), 
com.cybozu.labs:langdetect:jar:1.1-20120112 (compile), 
org.apache.myfaces.test:myfaces-test20:jar:1.0.7 (test), 
org.aspectj:aspectjweaver:jar:1.7.4 (compile), 
org.springframework:spring-context:jar:4.0.0.RELEASE (compile), 
org.springframework:spring-aspects:jar:4.0.0.RELEASE (compile), 
org.springframework:spring-tx:jar:4.0.0.RELEASE (compile), 
org.springframework:spring-test:jar:4.0.0.RELEASE (compile), 
org.springframework:spring-orm:jar:4.0.0.RELEASE (compile), 
org.springframework:spring-oxm:jar:4.0.0.RELEASE (compile), 
org.springframework:spring-jdbc:jar:4.0.0.RELEASE (compile), 
org.hibernate:hibernate-core:jar:4.1.7.Final (compile), 
commons-io:commons-io:jar:1.3.2 (compile), 
commons-lang:commons-lang:jar:2.4 (compile), 
commons-beanutils:commons-beanutils:jar:1.8.3 (compile), 
commons-validator:commons-validator:jar:1.3.1 (compile), 
log4j:log4j:jar:1.2.17 (compile), 
org.slf4j:slf4j-log4j12:jar:1.7.6 (compile), 
junit:junit:jar:4.11 (compile), 
junit-addons:junit-addons:jar:1.4 (compile), 
com.googlecode.log4jdbc:log4jdbc:jar:1.2 (compile), 
org.reflections:reflections:jar:0.9.9-RC1 (compile), 
oro:oro:jar:2.0.8 (compile), 
dbunit:dbunit:jar:2.1 (compile), 
com.h2database:h2:jar:1.3.175 (compile)]: 

Failed to read artifact descriptor for org.aspectj:aspectjweaver:jar:1.8.0.M1: 
    Could not transfer artifact org.aspectj:aspectjweaver:pom:1.8.0.M1 from/to in-project (file://${project.basedir}/libs): 
     Repository path /libs does not exist, and cannot be created. -> [Help 1] 

을의 org.aspectj:aspectjweaver:pom:1.8.0.M1에 문제가있는 것처럼 보인다, 그러나 나는 내 자신의 프로젝트 REPO을 주석 경우 CognosReportService (및 다시 설치)에서 갑자기 CognosReportWeb이 작동하기 시작합니다.

나는 정말로 혼란 스럽다. 내가 뭔가 잘못하고 있는거야?

모든 아이디어를 얻을 수 있습니다.

답변

0

Re "CognosReportService에서 프로젝트 내 리포를 주석 처리하고 다시 설치하면 갑자기 CognosReportWeb이 작동하기 시작합니다."

로컬 Maven 저장소 (기본값은 ~/.m2/repository 또는 settings.xmls)가 사용되며 이는 안정적으로 작동하는 것으로 알려져 있습니다. 따라서 갑자기 작동하는 이 아니므로 디자인에 따라 작동합니다. ;-)

마지막 메시지는 중요한 힌트를 제공합니다. file://${project.basedir}/libsorg.aspectj:aspectjweaver:pom:1.8.0.M1이 있습니까?

이 추가 리포지토리를 사용하는 이유는 무엇입니까?

+0

여분의 repo를 사용하는 이유는 제 3 자 jar를 maven 의존성으로 사용할 수 있기 때문입니다. 사람들이 로컬 소스 저장소에 이러한 jar 파일을 수동으로 삽입 할 필요없이 내 소스를 체크 아웃 한 후 Maven 빌드를 실행할 수있는 다른 방법을 생각할 수 없습니다. –

+0

@ValBlant [왜 Java jar 파일을 저장소에 저장하는 것이 좋지 않은지] (http://stackoverflow.com/questions/4649015/java-jar-files-into-a-repository-cvs-svn). –

0

Maven Central에서 의존성을 사용할 수없고 코드를 체크 아웃 한 사람이 추가 설정이나 jar 설치를하지 않고 소스를 빌드 할 수 있는지 확인하려면, 의존성이 호스팅됩니다.

프로젝트를 마치 로컬 파일 기반 저장소를 사용하는 경우를 제외하고 프로젝트에 추가하십시오.

<repositories> 
    <repository> 
     <id>opencastproject</id> 
     <url>http://repository.opencastproject.org/nexus/content/repositories/public/</url> 
    </repository> 
</repositories> 

그러나 귀하의 경우

org.aspectj:aspectjweaver LIB의 유사하거나 최신 버전은 메이븐 중앙에서 사용할 수 있습니다 - http://central.maven.org/maven2/org/aspectj/aspectjweaver/, 그래서 아마 당신은 대신

<dependency> 
    <groupId>org.aspectj</groupId> 
    <artifactId>aspectjweaver</artifactId> 
    <version>1.8.2</version> 
</dependency> 

를 사용할 수 있습니까?

+0

문제가 aspectjweaver와 아무런 관련이 없다고 생각합니다. 문제가있는 버전은 Hibernate 나 Spring의 다른 pom에 의해 요청되기 때문에 항상 경고를 보지만 빌드는 성공합니다.프로젝트 리포에 넣으려는 항아리는 공개 레포에서는 사용할 수 없으며 매우 희미하고 독점적 인 시스템입니다. Nexus를 조직에 설치하고 독점적 인 병을 배치하여 문제를 해결했습니다. 이제 빌드가 작동합니다. in-project repo에서 얻은 오류는 여전히 버그처럼 보입니다. –

관련 문제