简体   繁体   English

如何在Intellij Idea中运行Maven项目(并下载所有依赖项)?

[英]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.

相关问题 如何在Intellij Idea中使用Maven创建Servlet项目? - How can I create Servlet project with maven in Intellij Idea? 如何在IntelliJ IDEA中的Web应用程序项目中部署maven依赖项? - How do I deploy maven dependencies in a web application project in IntelliJ IDEA? IntelliJ IDEA中的java Maven项目,如何找到不需要的依赖项? - java Maven Project in IntelliJ IDEA, How do I find unneeded dependencies? 配置依赖性IntelliJ IDEA,Maven项目 - configuring dependencies intellij idea, maven project 如何使整个项目在IntelliJ IDEA中运行? - How can i make the whole project to run in IntelliJ IDEA? 如何使用Jenkins运行Intellij IDEA创建的Maven项目? - How to run a Intellij IDEA created Maven project with Jenkins? 如何在 Maven 项目中的单元测试上运行 IntelliJ 调试器? - How can I run the IntelliJ debugger on unit tests in a Maven project? 使用 IntelliJ IDEA 运行 Maven 项目 - Run a Maven Project using IntelliJ IDEA 如何使用Maven获得项目的所有嵌套依赖关系? - How can I get all nested dependencies of a project using Maven? 除了使用集成测试运行器在IntelliJ IDEA项目中以“IntegrationTest”结尾的所有JUnit单元测试之外,我该如何运行? - How can I run all JUnit unit tests except those ending in “IntegrationTest” in my IntelliJ IDEA project using the integrated test runner?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM