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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 02:24:33

问题


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.


回答1:


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.




回答2:


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`


来源:https://stackoverflow.com/questions/15599270/add-local-jar-to-maven-project-which-will-be-deployed-to-openshift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!