如何使这个(github)的源码进入一个库/ jar? [英] How to make this (github) source into a library/jar?

查看:202
本文介绍了如何使这个(github)的源码进入一个库/ jar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用这个来源: https://github.com/mongodb/casbah
我该如何使用这些东西?我想为一个图书馆做一个罐子。但我不知道如何。试用了Eclipse和IntelliJ。我下载了源代码:

I would like to use this source: https://github.com/mongodb/casbah How can I use this stuff? I would like to make a jar for a library. But I have no idea how. Tried it with Eclipse and IntelliJ. I downloaded the source with:

git clone git://github.com/mongodb/casbah

现在我有一个casbah文件夹;我将其复制到项目源(在Eclipse或IntelliJ中),但是我甚至不能编译它...总是有如下的东西:

Now I have a casbah folder; I copied it to the project source (in Eclipse or IntelliJ) but I am not even able to compile it...there's always something like:

error: '{' expected but identifier found.
package casbah-dynamic.src.main.scala

我必须编译吗?怎么样?编译后怎么样?这是一个Scala项目,但我认为这并不重要。作为Java项目,我必须做同样的事情。

Do I have to compile? How? And what after compiling? It's a Scala project, but I think that's not so important. As a Java project, I would have to do the same thing.

那么该怎么办?

编辑:我看到这些东西是存在的(它们的一些部分)作为一个jar( http://scala-tools.org/repo-releases/com/mongodb/ )。但是我想使用源码并学习如何使用它。

I saw this stuff is existing (some parts of them) as a jar (http://scala-tools.org/repo-releases/com/mongodb/). But I would like to use the source and learn how to use it.

推荐答案

使用SBT

> git clone git://github.com/mongodb/casbah.git
> cd casbah
> sbt package

你会得到几个罐子:

> find ./ -iname "*.jar"
./casbah-query/target/scala-2.9.1/casbah-query_2.9.1-3.0.0-SNAPSHOT.jar
./casbah-core/target/scala-2.9.1/casbah-core_2.9.1-3.0.0-SNAPSHOT.jar
./casbah-util/target/scala-2.9.1/casbah-util_2.9.1-3.0.0-SNAPSHOT.jar
./target/scala-2.9.1/casbah_2.9.1-3.0.0-SNAPSHOT.jar
./casbah-commons/target/scala-2.9.1/casbah-commons_2.9.1-3.0.0-SNAPSHOT.jar
./casbah-gridfs/target/scala-2.9.1/casbah-gridfs_2.9.1-3.0.0-SNAPSHOT.jar

这篇关于如何使这个(github)的源码进入一个库/ jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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