importing maven dependencies into intellij's classpath
I am using Buildr with a java/scala project. Dependencies are descried in the buildfile. An as you may know, Buildr downloads dependencies into ~.m2 folder (as maven2 does).
I am wondering how can I import dependencies (from ~.m2 folder or buildfile) into my Intellij project to en开发者_C百科joy the code completion and error detection among other features offered by Intellij.
Thanks, -A
buildr has a plugin to generate IntelliJ IDEA projects. It's described here:
If you use IntelliJ IDEA, you can generate project files by issuing:
$ buildr idea
It will generate a .iml file for every project (or subproject) and a .ipr that you can directly open for the root project. To allow IntelliJ Idea to resolve external dependencies properly, you will need to add a M2_REPO variable pointing to your Maven2 repository directory (Settings / Path Variables).
If you’re using IDEA 7 or later, use the buildr idea7x task instead. This task creates the proper .ipr and .iml files for IDEA version 7. It includes the -7x suffix in the generated files, so you can use the idea and idea7x tasks side by side on the same project.
精彩评论