Java Maven没有';看不到依赖

Java Maven没有';看不到依赖,java,maven,Java,Maven,我正在尝试向一个模块添加依赖项。代码如下: <dependency> <groupId>com.messagedna.dlp</groupId> <artifactId>producer</artifactId> <version>1.0</version> </dependency> 但当我试图编译第一个模块时,我得到了以下结果: Downloading

我正在尝试向一个模块添加依赖项。代码如下:

<dependency>
    <groupId>com.messagedna.dlp</groupId>
       <artifactId>producer</artifactId>
       <version>1.0</version>
    </dependency>
但当我试图编译第一个模块时,我得到了以下结果:

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)

如何构建它?

要在maven中使用库,它必须

  • 在马文中心
  • 在您有权访问的另一个存储库中
  • 本地安装

如果这些都不是,您需要按照maven提供的说明操作。

要在maven中使用库,它必须是

  • 在马文中心
  • 在您有权访问的另一个存储库中
  • 本地安装

如果这些都不是,您需要按照maven给您的说明进行操作。

看起来您没有在生产者项目和依赖它的项目之间建立正确的父子关系。在设置之前,您需要在producer项目上手动运行
mvn install
,然后再尝试构建任何依赖它的项目。

看起来您尚未在producer项目和依赖它的项目之间设置正确的父子关系。在设置之前,您需要在producer项目上手动运行
mvn install
,然后再尝试构建依赖它的任何项目。

您确定存储库中的项目已存在吗?您确定存储库中的项目已存在吗?
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)