qiGuar
qiGuar

Reputation: 1804

Intellij add jar as source

I have a project that uses some jar files that I also develop. I'm using maven as a build tool, so when I want to make changes in jar, I have to install it first and restart a project.
Is there a way to import this jar into my main project, so that I can make changes right from it and I could use hot swap to apply them?

Upvotes: 2

Views: 119

Answers (1)

Mustafa
Mustafa

Reputation: 2487

Assuming that you have sources for the other project (which I understand uses maven), you can accomplish this by adding the external project as a module to your active project.

  1. Open your active project in IntelliJ.
  2. Click File -> New -> Module from Existing Sources.
  3. Point to the source directory of the other project where the pom.xml is located.
  4. Hit OK.

You should now be able to modify the source of the jar library directly in your project without needing to publish/install it externally via maven and restart.

Upvotes: 1

Related Questions