【发布时间】:2018-01-04 06:36:28
【问题描述】:
我正在使用 Visual Studio Code 开发一个带有 maven 构建工具的 spring mvc 应用程序。
我的系统上安装了 maven 命令行。我还在我的 pom.xml 中添加了 tomcat 插件。我的应用程序的入口点是 web.xml。
我创建了 vs code 任务来在集成终端上运行 maven 命令。
我应该如何附加调试器断点以通过程序运行检查变量值。
我的 task.json 看起来像这样:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "verify",
"type": "shell",
"command": "mvn -B verify",
"group": "build"
},
{
"label": "test",
"type": "shell",
"command": "mvn -B test",
"group": "test"
},
{
"label": "create a new maven webapp",
"type": "shell",
"command": "mvn archetype:generate -DgroupId=com.lumen.app -DartifactId=lumen-app -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false",
"group": "test"
},
{
"label": "clean",
"type": "shell",
"command": "mvn clean",
"group": "test"
},
{
"label": "install",
"type": "shell",
"command": "mvn install",
"group": "test"
},
{
"label": "run on server",
"type": "shell",
"command": "mvn tomcat7:run",
"group": "test"
},
{
"label": "redeploy on server",
"type": "shell",
"command": "mvn tomcat7:redeploy",
"group": "test"
},
{
"label": "undeploy on server",
"type": "shell",
"command": "mvn tomcat7:undeploy",
"group": "test"
},
{
"label": "deploy on server",
"type": "shell",
"command": "mvn tomcat7:deploy",
"group": "test"
}
]
}
【问题讨论】:
-
Visual Studio Code 基本上是一个美化的文本编辑器。 Sprint MVC 是,AFAIK,几乎完全是一个 Java(即“非微软”)环境。而且 Maven 主要是一个构建工具——我不确定你认为它与 Visual Studio Code 或 Spring MVC 调试有什么关系:(所以基本上——祝你好运!就个人而言,我建议尝试使用 Eclipse。它集成得很好与Tomcat,并提供了一个很好的交互式构建和调试环境。恕我直言...
-
我创建了运行 maven 构建工具命令来编译项目、安装依赖项和运行应用程序的 vs code 任务。
标签: java spring maven spring-mvc visual-studio-code