将本地jar添加到Maven项目中,该项目将部署到Openshift [英] Add local jar to Maven project which will be deployed to Openshift

查看:281
本文介绍了将本地jar添加到Maven项目中,该项目将部署到Openshift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了要在另一个本地项目中使用的本地库,这两个都是maven项目.当我在Internet上阅读时,我已经将项目发布到本地Maven存储库,并将其用作Maven依赖项.问题是这是本地的,我想将此项目部署到OpenShift,服务器再次在其中构建应用程序.当然,由于本地依赖项,项目不会编译(服务器看不到此依赖项).如何解决这个问题呢?我应该在libs dir中添加* .jar并以这种方式进行连接吗?但是如何?我还没有在maven项目中找到方法.

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.

推荐答案

我已经解决了这个问题,但是我想以其他方式解决这个问题.但是,应用程序可以在OpenShift服务器上正确构建.通过使用以下命令在本地OpenShift存储库中安装jar解决了问题:

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`

这篇关于将本地jar添加到Maven项目中,该项目将部署到Openshift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆