【发布时间】:2019-07-01 19:33:28
【问题描述】:
我正在从 Eclipse 迁移到 VS-Code,并且正在尝试快速完成部署过程。我想创建一个 vs-code 任务来部署 WAR 文件。 我正在使用命令 adashen.vscode-tomcat:tomcat.war.run 但它似乎不起作用。
我将 Tomcat 用于 Visual Studio Code 扩展 v.0.11.1。
我的 tasks.json 看起来像这样:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "gradlew clean build",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Deploy",
"type": "shell",
"command": "adashen.vscode-tomcat:tomcat.war.run",
"args": ["${workspaceFolder}\\build\\libs\\SMEWeb-0.0.1-SNAPSHOT.war"]
}
]
}
执行后出现以下错误:
在 SMEWeb 文件夹中执行任务:adashen.vscode-tomcat:tomcat.war.run C:\WorkspaceGit\sme\SMEWeb\build\libs\SMEWeb-0.0.1-SNAPSHOT.war
文件名、目录名或卷标语法不正确。
终端进程命令'C:\Windows\system32\cmd.exe /d /c adashen.vscode-tomcat:tomcat.war.run C:\WorkspaceGit\sme\SMEWeb\build\libs\SMEWeb-0.0.1-SNAPSHOT.war' 启动失败(退出代码:1)
终端将被任务重用,按任意键关闭它。
有人知道吗? 谢谢
【问题讨论】:
-
如果不使用task,能否部署成功?
-
是的,我得去生成的WAR文件,右击“在Tomcat服务器上运行”。
-
你有没有尝试
cd生成war文件,然后在任务command中部署.war? -
是的,它不起作用。即使是一个简单的命令来启动没有 args 的 tomcat ("command": "adashen.vscode-tomcat:tomcat.server.start") 返回相同的错误..
标签: java tomcat visual-studio-code