java - 无法在 Visual Studio 代码中的 maven webapp 类型项目中添加嵌入式 Tomcat 服务器
问题描述
我是 java servlet 的新手,我正在尝试使用嵌入式 tomcat 服务器来运行我的 servlet。我在 POM.XML 中添加了这个插件。我正在使用 Visual Studio 代码。
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>9090</port>
</configuration>
</plugin>
我正在尝试运行命令mvn clean install以使用 tomcat 插件编译项目。然后这个错误不断出现。
PS F:\Project2020\ServletsInVSCode\servletdemo> mvn clean install
mvn : The term 'mvn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ mvn clean install
+ ~~~
+ CategoryInfo : ObjectNotFound: (mvn:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我不知道要解决这个问题。有人,请在这里帮助我。我知道很多关于 Maven 项目中的嵌入式 tomcat 的问题都被问过,但没有一个问题与我的问题相同。
解决方案
推荐阅读
- python - 'float' 对象不能被解释为数组的整数
- python - Ansible - 得到一个意外的关键字参数 - check_invalid_arguments
- javascript - 如何将字符串类型的两位小数相乘 javascript
- python - 在尝试附加数据帧时在 for 循环期间获取 NaN 值
- android - 检测到 Android Studio 设备但未识别为 Android 设备(ADB 故障)
- c - 显示控制PIC24FJ128GC010
- flutter - 缺少 (state.build) sqflite 的具体实现
- python - 我想使用 python 将数据从 word 表移动到 excel 表但不能这样做,当 Table 中有子列时我会遇到错误
- lua - 波浪号本身在 Lua 中是什么意思?
- r - 如何提取列表的每个第 n 个元素