如何在IntelliJ Idea中添加项目以构建路径 [英] How to add a project to build path in IntelliJ Idea

查看:7145
本文介绍了如何在IntelliJ Idea中添加项目以构建路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近转换为IntelliJ Idea 13,之前在eclipse中我能够将项目添加到另一个项目的构建路径。我无法在IntelliJ中完成此任务。



如何将project1添加到project2的构建路径,以便我可以将它用作依赖项。我不想让那个项目成为JAR,因为我还在开发它。



按照上述类似的问题:



非常感谢任何帮助或帮助。



修改:



解决方案(谢谢@leeor)



将项目导入为模块



文件>导入模块>(选择项目要导入)



这会将该项目添加到屏幕左侧的项目视图窗格中。



然后转到当前项目



文件>项目结构>模块>(选择当前项目)



在依赖项下



勾选要导入的项目(现在是模块),然后单击应用,然后单击应用。好。



完成!



在Mac上使用IntelliJ Idea 13.1.6

解决方案

如果你想依赖另一个模块而不是jar,你需要将它作为一个模块导入到同一个项目中。它不像导入DataProvider ,因为它没有出现在模块列表中。


I've recently converted over to IntelliJ Idea 13, previously in eclipse I was able to add a project to another project's build path. I'm not able to accomplish this in IntelliJ.

How can I add project1 to project2's build path so that I can use it as a dependency. I don't want to make that project a JAR because I'm still developing it.

Following this similar previous question: Intellij - Add project dependency like in Eclipse

I was not able to successfully achieve my goal.

In File > Project Structure > Modules

I see the project I'd like to add to my build path (DataProvider) but it's highlighted red, and the bottom warning text states "Invalid item 'DataProvider' in dependencies list'

Any help or assistance would be much appreciated.

Edit:

Solution (Thanks @leeor)

Import project as a module

File > Import Module > (Select Project to be imported)

This will add that project to the project view pane on the left side of the screen.

Then go to your current project

File > Project Structure > Module > (Select your current project)

Under Dependencies

Check mark your project (now a module) you want to import and then click apply and then OK.

Done!

Using IntelliJ Idea 13.1.6 on Mac

解决方案

If you want to depend on another module without it being jar, you need to import that as a module into the same project. It doesn't look like DataProvider is imported since it doesn't appear in the module list.

这篇关于如何在IntelliJ Idea中添加项目以构建路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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