2015-01-20 10 views
3

Maven을 사용하여 moquette을 빌드하려고합니다. Maven을 완전하게 초보자로 삼고 있습니다.Maven : 종속성을 해결할 수 없습니다. (이슈를 찾을 수 없습니다.)

빌드 할 때 다음 명령을 사용하고 있습니다.

MVN 클린 설치 -U

그리고

MVN -U를 설치 청소 | 다음에 그렙 ERROR

결과 :

[ERROR] Failed to execute goal on project moquette-broker: Could not resolve dependencies for project org.eclipse.moquette:moquette-broker:jar:0.7-SNAPSHOT: Could not find artifact org.mapdb:mapdb:jar:1.1.0-SNAPSHOT in Paho Releases (https://repo.eclipse.org/content/repositories/paho-releases/) -> [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 
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command 
[ERROR] mvn <goals> -rf :moquette-broker 

은의 전체 출력

: 깨끗한

MVN은 -e -X -U

here 찾을 수 있습니다 설치를 .

<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/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <netty.version>4.0.24.Final</netty.version> 
     <source.version>1.7</source.version> 
     <target.version>1.7</target.version> 
    </properties> 

    <groupId>org.eclipse.moquette</groupId> 
    <artifactId>moquette-parent</artifactId> 

    <packaging>pom</packaging> 
    <version>0.7-SNAPSHOT</version> 
    <name>Moquette MQTT parent</name> 
    <url>http://code.google.com/p/moquette-mqtt/</url> 


    <modules> 
     <module>parser_commons</module> 
     <module>netty_parser</module> 
     <module>broker</module> 
     <module>distribution</module> 
     <module>bundle</module> 
    </modules> 

    <reporting> 
     <plugins> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>cobertura-maven-plugin</artifactId> 
       <version>2.6</version> 
      </plugin> 
     </plugins> 
    </reporting> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>${source.version}</source> 
        <target>${target.version}</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

무엇이 문제를 일으키는 나는이 문제를 어떻게 해결합니까 : 같은

의 pom.xml 보인다?

+0

올바른 저장소를 사용하고 있습니까? 저장소 (https://repo.eclipse.org/content/repositories/paho-releases/)에 나열된 JAR 파일이 없습니다. – Ascalonian

답변

4

모켓의 documentation에 따르면, 간단한 mvn clean install 그것을 수행해야합니다

을 복제 소스와에 저장소, CD의 자식 클론 후 : MVN 깨끗한 패키지로 제공된다. 배포/대상 디렉토리에서 모든 종속성 및 실행 스크립트가있는 브로커의 자체 포함 된 tar 파일이 생성됩니다.

즉, 모든 것을 올바르게하고 있습니다.

그러나 종속성 org.mapdb : mapdb : jar : 1.1.0-SNAPSHOT이 누락되었습니다 (2015 년 1 월 20 일 기준). 즉, 설치 지침이 충분하지 않습니다.

MapDB documentation을 참조하면 야간 빌드를 저장소에 게시합니다. 당신이 저장소로이를 추가 할 경우, 그것은 작동합니다 (난 그냥 내 자신을이 검증) :

<repositories> 
    <repository> 
     <id>sonatype-snapshots</id> 
     <url>https://oss.sonatype.org/content/repositories/snapshots</url> 
    </repository> 
</repositories> 

당신은 당신의 치어 파일에서 직접이 정의를 넣어, 또는 받는다는 설치의 Settings.XML의 파일에 구성 할 수 있습니다 지침에 따라 here.

그래서 당신의 치어를 들어,이 다음과 같이 표시됩니다

<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/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <repositories> 
     <repository> 
      <id>sonatype-snapshots</id> 
      <url>https://oss.sonatype.org/content/repositories/snapshots</url> 
     </repository> 
    </repositories> 

    <properties> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <netty.version>4.0.24.Final</netty.version> 
     <source.version>1.7</source.version> 
     <target.version>1.7</target.version> 
    </properties> 

    <groupId>org.eclipse.moquette</groupId> 
    <artifactId>moquette-parent</artifactId> 

    <packaging>pom</packaging> 
    <version>0.7-SNAPSHOT</version> 
    <name>Moquette MQTT parent</name> 
    <url>http://code.google.com/p/moquette-mqtt/</url> 


    <modules> 
     <module>parser_commons</module> 
     <module>netty_parser</module> 
     <module>broker</module> 
     <module>distribution</module> 
     <module>bundle</module> 
    </modules> 

    <reporting> 
     <plugins> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>cobertura-maven-plugin</artifactId> 
       <version>2.6</version> 
      </plugin> 
     </plugins> 
    </reporting> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>${source.version}</source> 
        <target>${target.version}</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

설명하기 위해이 조금 더, 구성 저장소에서 필요한 유물에 대한 받는다는 확인합니다. 대부분의 경우,이 아티팩트는 "기본"리포지토리에 존재하며 추가 리포지토리가 필요하지 않습니다.

한편 자신 만의 메이븐 이슈를 만들고 자신의 메이븐 저장소를 호스팅한다고 가정 해 보겠습니다. 해당 저장소에 이슈를 게시합니다. 이제 다른 사용자가이를 사용하려는 경우 위와 유사한 구성을 수행해야합니다.

덧붙여서 -U은 강제로 업데이트합니다. maven이 종속성을 다운로드/다시 다운로드하도록 실제로 강제하지 않는 한 필요하지 않습니다.

+0

http : // pastebin에 pom.xml 파일을 편집했습니다. com/zxD9juY5를 입력하면 동일한 오류가 발생합니다. 내 pom.xml의 'project'태그 안에 저장소를 포함시켜야한다는 것을 이해했습니다. 따라서이 파일은 내게 맞는 것 같습니다. '~/.m2/settings.xml'이라는 빈 파일을 만들고 리포지토리를 붙여 넣으면이 오류가 발생합니다. – Wouter

+0

@Wouter 나는 당신의 질문을 실제로 잘못 읽었습니다. 야간 빌드를 저장하는 또 다른 저장소를 추가해야합니다. 문제의 의존성은 아직 "기본"maven 리포지토리에 영향을 미치지 않은 것처럼 보입니다. 내 업데이트 답변을 참조하십시오. – Magnilex

관련 문제