2013-07-12 4 views
0

Я пытаюсь добавить зависимость от одного модуля. вот код:Maven не видит зависимости

<dependency> 
    <groupId>com.messagedna.dlp</groupId> 
     <artifactId>producer</artifactId> 
     <version>1.0</version> 
    </dependency> 

Вот часть ПОМ файла модуля producer:

<parent> 
     <artifactId>DLP</artifactId> 
     <groupId>com.messagedna.dlp</groupId> 
     <version>1.0</version> 
    </parent> 
    <groupId>com.messagedna.dlp</groupId> 
    <artifactId>producer</artifactId> 
    <version>1.0</version> 
    <packaging>jar</packaging> 

    <name>producer</name> 

, но когда я пытаюсь скомпилировать первый модуль, я получаю следующее:

Downloading: http://repo1.maven.org/maven2/com/messagedna/dlp/producer/1.0/producer-1.0.pom 
[INFO] Unable to find resource 'com.messagedna.dlp:producer:pom:1.0' in repository central (http://repo1.maven.org/maven2) 
Downloading: http://repo1.maven.org/maven2/com/messagedna/dlp/producer/1.0/producer-1.0.jar 
[INFO] Unable to find resource 'com.messagedna.dlp:producer:jar:1.0' in repository central (http://repo1.maven.org/maven2) 
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] Failed to resolve artifact. 

Missing: 
---------- 
1) com.messagedna.dlp:producer:jar:1.0 

    Try downloading the file manually from the project website. 

    Then, install it using the command: 
     mvn install:install-file -DgroupId=com.messagedna.dlp -DartifactId=producer -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file 

    Alternatively, if you host your own repository you can deploy the file there: 
     mvn deploy:deploy-file -DgroupId=com.messagedna.dlp -DartifactId=producer -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] 

    Path to dependency: 
    1) com.messagedna.dlp:DLPServer:war:1.0-SNAPSHOT 
    2) com.messagedna.dlp:producer:jar:1.0 

---------- 
1 required artifact is missing. 

for artifact: 
    com.messagedna.dlp:DLPServer:war:1.0-SNAPSHOT 

from the specified remote repositories: 
    central (http://repo1.maven.org/maven2) 

как его построить?

+0

Вы уверены, что артефакт в репозитории? –

ответ

4

Похоже, что вы не установили правильные отношения между родителем и ребенком между проектом-продюсером и тем, что зависит от него. Пока вы не установили это, вам нужно вручную запустить mvn install в проекте производителя, прежде чем пытаться создать любой из проектов, которые зависят от него.

0

Чтобы использовать библиотеку в мавена она должна быть

  • в мавена центральной
  • в другом хранилище вы имеете доступ.
  • установить локально.

Если это не так, вам необходимо следовать инструкциям, которые дает вам maven.

Смежные вопросы