user7035883
user7035883

Reputation:

intellij idea how to use project A as library for project B

I want to use classes and interfaces from project A in project B. I tried to figure out how libraries, modules and maven work. But I can't find a useful tutorial. I don't want to just copy everything.

Upvotes: 0

Views: 56

Answers (1)

Kayvan Tehrani
Kayvan Tehrani

Reputation: 3210

If both of your projects are maven based, then the best approach is building the 'A' project artifact and add it as a dependency to project 'B' just like any other maven dependency.

If you want to edit both projects at the same time then you can import project 'A' as a maven module to the new project.

Just pay attention to rebuild the former artifact in case of any changes to be effective in the new project.

Upvotes: 1

Related Questions