pepuch
pepuch

Reputation: 6516

Add local jar to Maven project which will be deployed to Openshift

I've created local library which want to use in another local project, both are maven projects. As I read in the Internet I've published project to local maven repository and used it as maven dependency. The problem is that this is local and I want to deploy this project to OpenShift where application is built again by server. Of course project doesn't compile becouse of local dependency (server doesn't see this dependency). How to solve this problem? Should I add *.jar to libs dir and connect this in that way? But how? I haven't found how can I do it in maven project.

Upvotes: 0

Views: 1624

Answers (2)

pepuch
pepuch

Reputation: 6516

I've solved the problem but I wanted to solve this in a different way. However application builds on OpenShift server correctly. Problem solved by installing jar in local OpenShift repo using this command:

mvn install:install-file \
    -Dfile=multiplayergame-java-common-libs-0.9.jar \
    -DgroupId=pepuch \
    -DartifactId=multiplayergame-java-common-libs \
    -Dversion=0.9 \
    -Dpackaging=jar`

Upvotes: 1

Nam Duong
Nam Duong

Reputation: 851

There is a similar solution outlined in an OpenShift Knowledge Base here: https://www.openshift.com/kb/kb-e1040-using-your-own-jar-files-in-a-java-application

Hope that helps. Please feel free to chime in on the OpenShift Forums as well.

Upvotes: 1

Related Questions