如何在 Intellij Idea 上打开 Ant 项目(Nutch Source)? [英] How to Open an Ant project (Nutch Source) at Intellij Idea?
问题描述
我想打开 Nutch 2.1 源文件 (http://www.eu.apache.org/dist/nutch/2.1/) 在 Intellij IDEA.以下是如何在 Eclipse 中打开它的说明:http://wiki.apache.org/nutch/RunNutchInEclipse
I want to open Nutch 2.1 source file (http://www.eu.apache.org/dist/nutch/2.1/) at Intellij IDEA. Here is an explanation of how to open it at Eclipse: http://wiki.apache.org/nutch/RunNutchInEclipse
但是我不熟悉 Ant(我使用 Maven)并且当我打开该源文件时,Intellij 不知道许多类.即:
However I am not familiar with Ant (I use Maven) and when I open that source file many classes are not known by Intellij. i.e.:
org.apache.hadoop.mapreduce.JobContext
org.apache.gora.mapreduce.GoraMapper
如何将它们添加到库中或我该怎么做?
How can I add them to library or what should I do?
推荐答案
我终于知道怎么做了.现在我们的团队可以在 IntellIJ 中开发 nutch
I finally figure out how to do it. Now our team can dev nutch in IntellIJ
我们所做的过程
- 从 apache.org 获取 nutch 源
wget http://www.eu.apache.org/dist/nutch/2.3/apache-nutch-2.3-src.tar.gz
在intellij中导入nutch源
Import nutch source in intellij
通过 Ant 获取依赖
Get Dependencies by Ant
- 运行
ant runtime
- 运行
ant test
将依赖项导入 Intellij
Import dependencies into Intellij
- 文件 > 项目结构
- 图书馆>常春藤
- 点击加号按钮
- 选择
apache-nutch-2.3/build/lib
中的所有库
现在我们有一个带有 nutch 源代码和所有依赖项的项目
Now we have a project with nutch source and all dependencies
这篇关于如何在 Intellij Idea 上打开 Ant 项目(Nutch Source)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!