idea 编译断点运行 tomcat 10.1.28 源码

2024-09-05 04:36

本文主要是介绍idea 编译断点运行 tomcat 10.1.28 源码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

idea 编译运行 tomcat 10.1.28 源码

1. 所需资源

tomcat 10.1.28
zulu JDK 22
maven
idea (支持 JDK 22)

2. Idea 导入项目

10.1.28.tar.gz 解压到指定文件夹 如 ~\tomcat-source\tomcat-10.1.28
这里等待一段时间,生成 ~\tomcat-source\tomcat-10.1.28\.idea 文件夹

3. 替换Idea生成的临时配置文件

拷贝并覆盖 \tomcat-source\tomcat-10.1.28\res\ide-support\idea 所有文件到 ~\tomcat-source\tomcat-10.1.28\.idea

4. 确认idea 项目配置

  • 已安装 ant 插件
  • 当前 Project -> SDK 为 JDK 22
  • 当前 Project -> Language level 为 22
  • 当前 Project Structure -> apache-tomcat-10.1.28 Language level 为 22
  • File -> Settings -> Build, Execution, Deployment -> Compiler-> Java Compiler -> apache-tomcat-10.1.28 Target bytecode version 为 22
  • File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Runner -> JRE -> zulu 22

注意以上设置需为 JDK 22 版本, JDK21, 17 编译会有很多错误 (引入了22的一些特性)

5. 编译

  • ant 编译
    打开 ant 工具栏 View -> Tool Windows -> ant
    如果 ant 工具栏没有项目,则 点击 + 手动导入当前项目下的 build.xml
    运行 ant 工具栏下的 clean, deploy

当前 Project 项目下会生成一个文件夹 output
在这里插入图片描述

  • maven 编译
    当前项目下 新建一个pom.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.boostarea</groupId><artifactId>apache-tomcat-10.1.28</artifactId><name>apache-tomcat-10.1.28</name><version>10.1.28</version><build><finalName>apache-tomcat-10.1.28</finalName><sourceDirectory>java</sourceDirectory><testSourceDirectory>test</testSourceDirectory><resources><resource><directory>java</directory></resource></resources><testResources><testResource><directory>test</directory></testResource></testResources><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.13.0</version><configuration><encoding>UTF-8</encoding><source>22</source><target>22</target></configuration></plugin></plugins></build><dependencies><dependency><groupId>org.apache.ant</groupId><artifactId>ant</artifactId><version>1.10.14</version></dependency><dependency><groupId>org.apache.ant</groupId><artifactId>ant-apache-log4j</artifactId><version>1.10.14</version></dependency><dependency><groupId>org.apache.ant</groupId><artifactId>ant-commons-logging</artifactId><version>1.10.14</version></dependency><dependency><groupId>wsdl4j</groupId><artifactId>wsdl4j</artifactId><version>1.6.3</version></dependency><dependency><groupId>jakarta.xml.rpc</groupId><artifactId>jakarta.xml.rpc-api</artifactId><version>1.1.4</version></dependency><dependency><groupId>org.eclipse.jdt</groupId><artifactId>ecj</artifactId><version>3.38.0</version></dependency><dependency><groupId>org.apache.tomcat</groupId><artifactId>jakartaee-migration</artifactId><version>1.0.7</version></dependency><dependency><groupId>biz.aQute.bnd</groupId><artifactId>biz.aQute.bndlib</artifactId><version>7.0.0</version></dependency></dependencies>
</project>

执行 maven clean compile,当前目录下生成 target 文件夹
在这里插入图片描述

maven pom.xml 文件导入目的为了后面可以debug tomcat

6. 配置debug/run当前已编译的 tomcat

新建一个应用配置
Name: tomcat
Build an run: java 22
module: apache-tomcat-10.1.28 (下拉选)
main class: org.apache.catalina.startup.Bootstrap
Working directory: D:\GitHub\tomcat-source\tomcat-10.1.28\output\build

如下图
在这里插入图片描述

7. debug 验证

设置tomcat 断点
在这里插入图片描述

基于上面应用配置 启动 debug
在这里插入图片描述
访问 http://localhost:8080
在这里插入图片描述
访问 http://localhost:8080/examples/
在这里插入图片描述

这篇关于idea 编译断点运行 tomcat 10.1.28 源码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1137957

相关文章

Idea实现接口的方法上无法添加@Override注解的解决方案

《Idea实现接口的方法上无法添加@Override注解的解决方案》文章介绍了在IDEA中实现接口方法时无法添加@Override注解的问题及其解决方法,主要步骤包括更改项目结构中的Languagel... 目录Idea实现接China编程口的方法上无法添加@javascriptOverride注解错误原因解决方

Tomcat高效部署与性能优化方式

《Tomcat高效部署与性能优化方式》本文介绍了如何高效部署Tomcat并进行性能优化,以确保Web应用的稳定运行和高效响应,高效部署包括环境准备、安装Tomcat、配置Tomcat、部署应用和启动T... 目录Tomcat高效部署与性能优化一、引言二、Tomcat高效部署三、Tomcat性能优化总结Tom

通过prometheus监控Tomcat运行状态的操作流程

《通过prometheus监控Tomcat运行状态的操作流程》文章介绍了如何安装和配置Tomcat,并使用Prometheus和TomcatExporter来监控Tomcat的运行状态,文章详细讲解了... 目录Tomcat安装配置以及prometheus监控Tomcat一. 安装并配置tomcat1、安装

在idea中使用mysql数据库超详细教程

《在idea中使用mysql数据库超详细教程》:本文主要介绍如何在IntelliJIDEA中连接MySQL数据库,并使用控制台执行SQL语句,还详细讲解了如何使用MyBatisGenerator快... 目录一、连接mysql二、使用mysql三、快速生成实体、接口、sql文件总结一、连接mysql在ID

mysqld_multi在Linux服务器上运行多个MySQL实例

《mysqld_multi在Linux服务器上运行多个MySQL实例》在Linux系统上使用mysqld_multi来启动和管理多个MySQL实例是一种常见的做法,这种方式允许你在同一台机器上运行多个... 目录1. 安装mysql2. 配置文件示例配置文件3. 创建数据目录4. 启动和管理实例启动所有实例

IDEA如何让控制台自动换行

《IDEA如何让控制台自动换行》本文介绍了如何在IDEA中设置控制台自动换行,具体步骤为:File-Settings-Editor-General-Console,然后勾选Usesoftwrapsin... 目录IDEA如何让控制台自http://www.chinasem.cn动换行操作流http://www

使用TomCat,service输出台出现乱码的解决

《使用TomCat,service输出台出现乱码的解决》本文介绍了解决Tomcat服务输出台中文乱码问题的两种方法,第一种方法是修改`logging.properties`文件中的`prefix`和`... 目录使用TomCat,service输出台出现乱码问题1解决方案问题2解决方案总结使用TomCat,

IDEA运行spring项目时,控制台未出现的解决方案

《IDEA运行spring项目时,控制台未出现的解决方案》文章总结了在使用IDEA运行代码时,控制台未出现的问题和解决方案,问题可能是由于点击图标或重启IDEA后控制台仍未显示,解决方案提供了解决方法... 目录问题分析解决方案总结问题js使用IDEA,点击运行按钮,运行结束,但控制台未出现http://

解决Spring运行时报错:Consider defining a bean of type ‘xxx.xxx.xxx.Xxx‘ in your configuration

《解决Spring运行时报错:Considerdefiningabeanoftype‘xxx.xxx.xxx.Xxx‘inyourconfiguration》该文章主要讲述了在使用S... 目录问题分析解决方案总结问题Description:Parameter 0 of constructor in x

解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题

《解决IDEA使用springBoot创建项目,lombok标注实体类后编译无报错,但是运行时报错问题》文章详细描述了在使用lombok的@Data注解标注实体类时遇到编译无误但运行时报错的问题,分析... 目录问题分析问题解决方案步骤一步骤二步骤三总结问题使用lombok注解@Data标注实体类,编译时