将外部JAR添加到Openshift [英] Adding External JARs to Openshift

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

问题描述

我有一个非常基本的Java Web应用程序(使用Eclipse openshift插件创建)。该应用程序在OpenShift服务器上运行良好。现在我需要使用外部JAR库在Java中进行JSON解析和创建。我无法理解如何将这个JAR添加到openshift服务器。

I have a pretty basic Java web application (created using Eclipse openshift plugin). The app runs fine on the OpenShift server. Now I need to use an external JAR library for JSON parsing and creation in Java. I can't understand my way around how to add that JAR to openshift server.

我去了项目属性>> BuildPath >>添加外部JAR 。虽然这确实导入了JAR,但它在openshift服务器上不起作用并且给出了与该文件的导入有关的错误( NoClassDefFound ,我猜)。你能告诉我如何将外部jar导入openshift项目吗?

I went to project properties>>BuildPath>>Add external JAR. While that does import the JAR, it does not work on openshift server and gives error relating to that file's import (NoClassDefFound, I guess). Could you tell me how to import external jars into openshift project?

推荐答案

由于我们使用Maven进行构建过程,所有你拥有的要做的是将它作为依赖项添加到你的pom.xml中

Since we use Maven for the build process, all you have to do is add it as a dependency in your pom.xml

这是一个添加mongo驱动程序的例子

Here is an example that adds a mongo driver

https://github.com/thesteve0/openshift -mongo-spatial-jee6 / blob / master / pom.xml

查看依赖项标签

这篇关于将外部JAR添加到Openshift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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