• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 120
  • Last Modified:

How to include a folder from another project in intellij idea

HI,
I have two projects A and B... The project A uses B as dependency..
While working on Project A i have to make change simulataneously in A and B.
This will cause me to open the project B in another instance of intellij Idea and build it and then use this latest build of B in A. Which is quite troublesome..
If i could include the source of B directly in A and make changes there only things will be very easy..
How do i do that..
Also i saw that intellij i cannot open two projects in the same instance...

To give the exact case of my scenario :
I have a project A which is a web application...
And it uses an npm module called B in its javascript files which is another project.
eg... in a new.js i include B like :
require(B)
B is listed as a dependency in package.json...
Now i have to make changes in A and B simulatenously and test my changes...
what i have done currently is manually copy the files i need in B directly in a folder in A and then work.. And when i am finished... copy them back to project B...
I tried creating an alias of files in B. So as i dont have to copy them back and forth.. But intellij doesnt seem to work with aliases...

Thanks
0
Rohit Bajaj
Asked:
Rohit Bajaj
  • 2
1 Solution
 
dpearsonCommented:
I think A and B should both be modules within a single project.

Then you go to "Project structure, Modules" and select A, then in the Dependencies tab for A, add "Module B" (click the "+" at the side and choose Module Dependency...).

Now when you edit B, it will be compiled into A as needed.

You can still have a separate run target for just B if you wish too, for when you want to run B separately from A.

Give that a try and see if that solves your problem,

Doug
0
 
dpearsonCommented:
Only solution submitted.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now