- pom引入插件
<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.4.53.v20231009</version> <configuration> <webApp> <contextPath>/</contextPath> </webApp> </configuration> </plugin>
- 项目设置为war形式
<packaging>war</packaging>
- Idea的Edit Configurations 然后选择Maven 点击 ‘+号’ 进行配置
a. Name: spring-mvc-hello-webmvc(根据个人爱好自定义) b. Working directory: 选中要运行的项目 c. Command line: clean jetty:run
- 点击 Debug 图标运行项目
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交