使用 Maven 和 IDEA 提升:Scala 插件找不到依赖项

发布于 2024-12-25 07:52:15 字数 1374 浏览 3 评论 0原文

我正在使用 Intellij IDEA 11、Scala 2.9.1 和 Lift 2.4M4。

我创建了一个 Maven 模块(遵循此处的“使用纯 Maven”说明) 基于 Scala 2.9.1 和 Lift 2.4 里程碑 4 原型。我手动添加了 Web 和 Scala 方面,对于 Scala 方面,我将编译器库设置为指向我(手动)安装的 Scala 2.9.1。

我可以使用 Maven 构建模块,但在 Scala 编辑器中,我看到的都是红色——它不知道在哪里可以找到 sbt,它不知道在哪里可以找到 net .liftweb 等。我考虑过尝试在本地 Maven 存储库中进行修改并找到相关的 JAR,然后将它们添加为普通的 IDEA 模块依赖项,但考虑到我在第一名,这个好像精神错乱。

请注意,我对 IDEA 非常有经验,但是 在 IDEA 中使用 Maven 的经验不是很丰富,而且我在 Scala 方面几乎是个初学者。我应该在这里做什么?


注意:我见过这个问题,但我希望避免使用sbt,即使它是 Scala 的做事方式,因为我们有一个巨大的 Java 代码库,它只是勉强从 Ant 转换而来到马文;新的 Web 框架和新的编程语言已经很难推销了,而无需说服从发布工程到副总裁级别的所有人,我们也需要一个新的构建系统。我想要的是可行的 Maven 构建和愉快的 IDEA 编码。


更新:我将下面 fmpwizard 的响应标记为答案,因为它让我找到了实际问题,即 IDEA .iml 文件没有拾取任何来自 POM 的依赖项。也就是说,我不认为在 2012 年使用 IDEA Maven 插件生成 .iml 文件是一个明智的解决方案。我认为 IDEA 应该为你做这件事,而且我已经 提交了一个错误

I'm using Intellij IDEA 11, Scala 2.9.1, and Lift 2.4M4.

I've created a Maven module (following the "Using Pure Maven" instructions here) based on the Scala 2.9.1 and Lift 2.4 milestone 4 archetype. I've added Web and Scala facets by hand, and for the Scala facet, I've set the compiler library to point to my (manual) installation of Scala 2.9.1.

I can build the module with Maven, but in the Scala editor, all I see is red -- it doesn't know where to find sbt, it doesn't know where to find net.liftweb, etc., etc. I've contemplated trying to hack around in my local Maven repository and find the relevant JARs, then add them as ordinary IDEA module dependencies, but given that I'm using Maven in the first place, this seems demented.

Note that I'm pretty experienced with IDEA but not very experienced using Maven with IDEA, and I'm pretty much a beginner at Scala. What am I supposed to be doing, here?


Note: I've seen this question but I hope to avoid using sbt, even though it's the Scala Way To Do Things, because we've got a giant Java codebase that's only barely converted over from Ant to Maven; a new web framework and new programming language are going to be a tough enough sell already, without having to convince everyone from release engineering up to the VP level we need a new build system as well. What I want is workable Maven builds and pleasant IDEA coding.


Update: I marked fmpwizard's response below as the answer, because it led me to the actual problem, namely, that the IDEA .iml file hadn't picked up any of the dependencies from the POM. That said, I don't think using the IDEA Maven plugin to generate .iml files is a sensible solution in 2012. I think IDEA is supposed to do this for you, and I've filed a bug.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江南月 2025-01-01 07:52:16

您使用的 lift 不是问题,请尝试使用这个 maven 插件将手动添加 IDEA 依赖项。

That you are using lift is not an issue, try using this maven plugin which will do the manual work of adding dependencies to IDEA.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文