tomcat 源码部署 (源码跟踪 部署 记录 IDEA 版本 ) 第一部分
记录tomcat 源码部署到 IDEA中 的方式 (此方法适用所有的版本 附录包含 Pom.xml)
首先下载tomcat源码 这里 自己修改版本根据需求自己下载 一步步走 别跳步骤 不然 会报错的
下载地址: tomcat源码
下载后解压放在 没有中文没有 空格的目录下面
新增 一个 pom.xml(在解压后的 主目录里面增加 )

1 <?xml version="1.0" encoding="utf-8"?> 2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4 <modelVersion>4.0.0</modelVersion> 5 <groupId>org.apache.tomcat</groupId> 6 <artifactId>Tomcat8.5</artifactId> 7 <name>Tomcat8.5</name> 8 <version>8.5</version> 9 <build> 10 <finalName>Tomcat8.0</finalName> 11 <!-- 指定源文件为java 、test --> 12 <sourceDirectory>java</sourceDirectory> 13 <testSourceDirectory>test</testSourceDirectory> 14 <resources> 15 <resource> 16 <directory>java</directory> 17 </resource> 18 </resources> 19 <testResources> 20 <testResource> 21 <directory>test</directory> 22 </testResource> 23 </testResources> 24 <plugins> 25 <plugin> 26 27 <groupId>org.apache.maven.plugins</groupId> 28 <artifactId>maven-compiler-plugin</artifactId> 29 <version>3.8.1</version> 30 <configuration> 31 <encoding>UTF-8</encoding> 32 <!-- 指定jdk 编译 版本 ,没装jdk 1.7的可以变更为1.6 --> 33 <source>1.8</source> 34 <target>1.8</target> 35 </configuration> 36 </plugin> 37 </plugins> 38 </build> 39 <!-- 添加tomcat8 所需jar包依赖 --> 40 <dependencies> 41 <dependency> 42 <groupId>junit</groupId> 43 <artifactId>junit</artifactId> 44 <version>4.12</version> 45 <scope>test</scope> 46 </dependency> 47 <dependency> 48 <groupId>ant</groupId> 49 <artifactId>ant</artifactId> 50 <version>1.7.0</version> 51 </dependency> 52 <dependency> 53 <groupId>wsdl4j</groupId> 54 <artifactId>wsdl4j</artifactId> 55 <version>1.6.2</version> 56 </dependency> 57 <dependency> 58 <groupId>javax.xml</groupId> 59 <artifactId>jaxrpc</artifactId> 60 <version>1.1</version> 61 </dependency> 62 <dependency> 63 <groupId>org.easymock</groupId> 64 <artifactId>easymock</artifactId> 65 <version>3.3</version> 66 </dependency> 67 <dependency> 68 <groupId>org.eclipse.jdt.core.compiler</groupId> 69 <artifactId>ecj</artifactId> 70 <version>4.6.1</version> 71 </dependency> 72 </dependencies> 73 </project>
拖入IDEA中 在新窗口打开
修改 JDK版本 (如果确定你的版本是对的就不用 在 修改了)
增加启动 main 方法
然后就是正常的操作即可 (这里的你加不加都是ok的 )
加也可以 内容是
-Dcatalina.home="自己的目录"
后续就是正常的操作了 你想干啥都可以 运行中有问题可以留言看见会及时回复的 QQ 522442116