0

I have created a new IntelliJ Project, and I want it to have JAR dependencies like I have in another project.

Is there a way to Export-Import / Copy-Paste JAR dependencies from one IntelliJ project to another without using POM?

Thanks.

Optional Solution:

1. Open <old-project>/.idea/libraries folder and <new-project>/.idea/libraries folder. 2. Make sure to enable the displaying of hidden files (in Win7, go to control-panel--> Folder Options --> View, and select the 'Show hidden files...') 3. Copy all XML files exists in .idea/libraries from the old project to the new one. 4. Make sure that each xml points to the right location of Jar. (In case of relative link) 5. Open the <old-project>.iml and <new-project>.iml, and copy all <orderEntry type="library" name"..."/> elements. 6. Restart your new project. 

1 Answer 1

1

I'm not aware of a way to do this from within IDEA, but under your project folder you can find a directory called .idea/libraries that has a series of XML files, one for each external dependency. You should be able to copy these between projects and thus "share" dependencies.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. Already tried it but: 1. It didn't work (maybe there is a need to update the workspace.xml as well), 2. I hoped to find a way to do it from the IntelliJ itself
So, it seems that copying the .idea/libraries + updating the <project>.iml file (just copy all orderEntry elements) will add the jars into the new project. Still looking for more IntelliJ way to do that

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.