idea 构建java路径,如何在IntelliJ Idea中添加项目以构建路径

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.

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'

EYocW.png

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值