[英]How can I run a Maven project in Intellij Idea (and have all dependencies downloaded)?
In Intellij IDEA I created a Maven project and added dependencies to the pom.xml
file. 在Intellij IDEA中,我创建了一个Maven项目并将依赖项添加到
pom.xml
文件中。 However when I run the project using ALT + SHIFT + F10 , as with 'plain' projects, I get ClassNotFoundException
s. 但是,当我使用ALT + SHIFT + F10运行该项目时,与“普通”项目一样,我会收到
ClassNotFoundException
。
My question is: is that the proper way to run a Maven project, and have all the dependencies been downloaded? 我的问题是:这是运行Maven项目的正确方法,是否已下载所有依赖项? Or is there another way?
还是有另一种方法?
Reload all dependencies: CTRL + SHIFT + A and input "reimport" as an action. 重新加载所有依赖项: CTRL + SHIFT + A并输入“ reimport”作为操作。 You will find the "Reimport All Maven Projects" option.
您将找到“重新导入所有Maven项目”选项。 Afterwards, rebuild the project.
之后,重建项目。
I am more experienced with setting it up on Eclipse but I believe the Intellij plugin should also offer some option to Update Maven Dependencies, which should download the jars you are missing. 我更经历了设置它在Eclipse上,但我相信的IntelliJ插件也应该提供一些选项来更新Maven依赖,这应该下载你缺少的罐子。
In fact, a quick search I just did directed me at this post Force Intellij IDEA to reread all maven dependencies 事实上,快速搜索我只是针对我这个帖子力的IntelliJ IDEA重读所有Maven依赖
Good luck! 祝好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.