MyEclipse 使用外部tomcat 调试springboot
2021-05-13 09:27
标签:clip webapp mic maven cal servlet hid system conf 在网上找了一些调试springboot 的文章,使用内置tomacat步骤大体都是如下步骤 2.启动maven命令:clean install -Ptest -X spring-boot:run 3.开调试 右击项目–>选择debug as–>Debug Configuration–>Remote Java Application 配置地址和端口号 localhost 5005 我按照此方法总是不行,所以换成了使用外部tomcat调试springboot的方案 (1) 新建-》Other->搜索maven 如下图 (2) 下一步 (3) 输入名称 (4) 点击完成 (5) 修改pom.xml,添加对springboot 的引用 如下内容: (6)创建mainApplication 如下内容 7引入tomcat,打开官网,下载tomcat-9 8.tomcat添加到myeclipse,windows->preferences 9运行调试,选择tomcat9作为server 10访问地址http://localhost:8080/tomcattest/hello
发现断点已经进来了 MyEclipse 使用外部tomcat 调试springboot 标签:clip webapp mic maven cal servlet hid system conf 原文地址:https://www.cnblogs.com/qiejinxing/p/13130938.html1.配置插件:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
package com.tomcat.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@SpringBootConfiguration
@Controller()
@SpringBootApplication
public class mainApplication extends SpringBootServletInitializer{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(mainApplication.class);
}
public static void main(String[] args) throws Exception {
System.out.println("starting........................................................");
// SpringApplication.run(bootApplication.class, args);
SpringApplication alApplication = new SpringApplication(mainApplication.class);
//alApplication.setBannerMode(Mode.OFF);
alApplication.run(args);
}
@RequestMapping("/hello")
@ResponseBody
public String Hello() {
return "1";
}
}
文章标题:MyEclipse 使用外部tomcat 调试springboot
文章链接:http://soscw.com/essay/85069.html