开发者

importing maven dependencies into intellij's classpath

开发者 https://www.devze.com 2022-12-15 10:20 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消