This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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 :
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 -
Path to dependency:
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.
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.