File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Unable to resolve dependency to a jar file created by MVN in 1st module. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Unable to resolve dependency to a jar file created by MVN in 1st module." Watch "Unable to resolve dependency to a jar file created by MVN in 1st module." New topic
Author

Unable to resolve dependency to a jar file created by MVN in 1st module.

Thapliyal Akshat
Greenhorn

Joined: Jun 04, 2009
Posts: 29
Hello Everyone,

I am having two modules: Java, Web modules and an Ear Module.

The Java Module is independent (Contains Ejb and Java).

Web module is dependent on Java Module and,

Ear module will create an ear which contains the Java Module and the Web Module.

When I execute my mvn clean package command on the parent pom. It executes the java module first and creates a jar file. As Web module is dependent on Java module it tries to download my jar file from our internal repositories and as that jar file is not available in the internal repository it throws me the error saying :



Missing:
----------
1) com.gen.term:term-java:jar:1.0

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.gen.term -DartifactId=term-java -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.gen.term -DartifactId=term-java -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file -
Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) com.gen.term:term-web:war:1.0
2) com.gen.term:term-java:jar:1.0

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

for artifact:
com.ga.term:term-web:war:1.0

from the specified remote repositories:
internal-repository (http://xx45xx.xxxx.xxx.xx.com:8080/archiva/repository/maven),
proximity (http://repo1.xxx.net/proximity/repository/public),
XXXX.eRepo (http://x85x.xxxx.xxxx.xxxx.com:8080/archiva/repository/xxxxx)



I know that by explicitly invoking java pom.xml I can create a jar file and using mvn intsall explicitly I can install the jar file created in first step. But I don't want to do that.
I want the Web module should be able to pick my jar file that has been created in the first step.

Below is the dependency code snippet of my Web module.




Please respond.


Thanks in Advance.
Akshat Thapliyal

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

You need to make sure that the first maven build places the java module into the local maven repository so that the second maven build can find it. Did you run the "install" target for the first maven build?

Oh, and please do not bold large blocks of text - it makes your post difficult to read.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to resolve dependency to a jar file created by MVN in 1st module.
 
Similar Threads
Creating an ear file from war and jar files
Error Compiling Maven Project
Maven Dependency issue
Hibernate Jars Updation
add lib jars to war file using maven