IDEA doesn't generate pom.xml when adding .JAR-library via Maven repository

Answered

I added an external JAR-library via Maven repository to the basic Java project structure. Everything is working except one thing. When I add a .JAR I expect that IDEA will generate a pom.xml inside of the project. But it doesn't happen.

So how can I create a pom.xml file? As far as I understand, one of the option is create Java Maven project, but I really don't want to recreate the whole project. Is there any easy way to tune IDEA that it will generate a dependencies file pom.xml in order to benefit from all Maven functionality.

P.S. One more question. If I added JARs via Maven to the basic Java Project. Will Maven/IDEA track the JARs for the update?

Thanks.

4 comments
Comment actions Permalink

Maven integration is one way only. IDEA can import existing pom.xml files, but it will not update pom.xml if you add a dependency manually in the project structure.

Updates are also not tracked this way. You have to start with a Maven project or import pom.xml project, then add dependencies into pom.xml (there is an intention action for that).

0
Comment actions Permalink

Thanks for the information.

Could you, please, clarify how to import existing pom.xml file to existing Java project?

Thanks.

0
Comment actions Permalink

It doesn't work with existing project, you create a new project from Maven. Refer to help for details: https://www.jetbrains.com/idea/help/maven.html .

0
Comment actions Permalink

«It doesn't work with existing project» — yeap, that's the problem.

Anyway, thanks for the link.

0

Please sign in to leave a comment.