java - 将 Maven 依赖项导入 intellij 的类路径

标签 java maven-2 scala intellij-idea buildr

我在 java/scala 项目中使用 Buildr。 构建文件中描述了依赖关系。如您所知,Buildr 将依赖项下载到 ~.m2 文件夹中(与 maven2 一样)。

我想知道如何将依赖项(从 ~.m2 文件夹或构建文件)导入我的 Intellij 项目,以享受 Intellij 提供的代码完成和错误检测等功能。

谢谢, -A

最佳答案

buildr 有一个插件来生成 IntelliJ IDEA 项目。它描述了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.

关于java - 将 Maven 依赖项导入 intellij 的类路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1989678/

相关文章:

java - 无法克服这个 org.springframework.dao.dataaccessException

java - 点到线的距离不起作用

scala - 在构建FlowGraph时,如何连接两个Flow?

scala - 如何在 Scala 中创建时间戳序列

JavaFX ImageView : Can I retrieve the scaled image size when preserveRatio = true?

Java,如何使用 Jackson ObjectMapper 反序列化双重嵌套 json 列表

Maven:不可解析的父 POM 和 'parent.relativePath' 指向错误的本地 POM

apache-flex - 带有配置文件的条件 Maven 构建部分?

java - maven 项目警告 'DTD or XML schema' 上的 eclipse

scala - 无法使用程序集插件