gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 08:18:51 25 4
gpt4 key购买 nike

我在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com