2

I'm trying to add dependency to one module. here is the code:

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

Here is the part of the pom file of the module 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> 

but when I'm trying to compile the first module I get the following:

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) 

how to make it build?

1
  • Are you sure that the artifact in repository? Commented Jul 12, 2013 at 13:06

2 Answers 2

4

It looks like you haven't set up a proper parent-child relationship between the producer project and the one that depends on it. Until you set that up, you'll need to manually run mvn install on the producer project before trying to build any of the projects that depend on it.

Sign up to request clarification or add additional context in comments.

Comments

0

To use a library in maven it must be

  • in maven central
  • in another repository you have access to.
  • install locally.

If it is none of these, you need to follow the instructions maven gives you.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.