Issue
I developed my sample project with two modules. myapp-core
for repository purpose and myapp-front
for public use. I made both projects with maven default archetype. myapp-core
was packed as jar and myapp-front
as war.
I added myapp-core
as dependency for myapp-front
in pom.xml of myapp-front
as
<dependency>
<groupId>com.mycom.myapp</groupId>
<artifactId>myapp-core</artifactId>
<version>1.0</version>
</dependency>
This is working fine at my local machine (run with eclipse , tomcat) . I had tried to host my sample app to OpenShift but I don't know exactly how to deploy both of my projects. So , I googled and just only deploy myapp-front
.
Now I got error
remote: [ERROR] Failed to execute goal on project myapp-front: Could not resolve dependencies for project myapp-front:myapp-front:war:1.0: Could not find artifact com.mycom:myapp-core:jar:1.0 in eap (http://maven.repository.redhat.com/techpreview/all) -> [Help 1]
I followed the guid from Without using Maven guide (I created lib folder and added myapp-core.jar
) but the same error has occured. So , I removed myapp-core.jar
dependency declaration from pom.xml but class not found errors were occured (it means my jar file is not include) .
Can somebody guide me kindly with step by step to solve my problem ? Be happy with helping a noob. Thanks for reading my question.
Solution
You have a few choices for making the dependent module accessible.
Use the Maven Install goal to load the dependent module in your local repository.
Put the two modules as subdirectories of a parent module. If the modules are nested in this way, the modules can find each other. See the layout of the bradleyross/tutorials project at https://github.com/BradleyRoss/tutorials (documentation at http://bradleyross.github.io/tutorials/) where tutorials-webapp1 and tutorials-common have the same arrangement.
Answered By - Bradley Ross