Skip to content

Commit 674f2f1

Browse files
committed
适配在IDEA中右键直接运行应用
1 parent 48e347c commit 674f2f1

File tree

5 files changed

+261
-15
lines changed

5 files changed

+261
-15
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,10 @@ http://localhost:8080/rce/exec?cmd=whoami
8080
Viarus
8181
```
8282

83+
---
84+
85+
有人反馈不想额外下载Tomcat,想使用SpringBoot自带的Tomcat,所以额外添加了这个小功能。
86+
执行`cp pom-idea.xml pom.xml`后,最后在IDEA中右键`Run Application`
87+
88+
89+

java-sec-code.iml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
<orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.22" level="project" />
4444
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.6.RELEASE" level="project" />
4545
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
46+
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.5.1.RELEASE" level="project" />
47+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.11" level="project" />
48+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.11" level="project" />
49+
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.11" level="project" />
4650
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.3.4.Final" level="project" />
4751
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
4852
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" />
@@ -56,7 +60,6 @@
5660
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.6.RELEASE" level="project" />
5761
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.6.RELEASE" level="project" />
5862
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.6.RELEASE" level="project" />
59-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.tomcat:tomcat-servlet-api:8.0.36" level="project" />
6063
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:1.5.1.RELEASE" level="project" />
6164
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring4:2.1.5.RELEASE" level="project" />
6265
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:2.1.5.RELEASE" level="project" />

pom-extra.xml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>sec</groupId>
8+
<artifactId>java-sec-code</artifactId>
9+
<version>1.0.0</version>
10+
<packaging>war</packaging>
11+
12+
13+
<parent>
14+
<groupId>org.springframework.boot</groupId>
15+
<artifactId>spring-boot-starter-parent</artifactId>
16+
<version>1.5.1.RELEASE</version>
17+
</parent>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>org.springframework.boot</groupId>
22+
<artifactId>spring-boot-starter-web</artifactId>
23+
<!-- 移除嵌入式tomcat插件,为了使用非嵌入式的tomcat -->
24+
<exclusions>
25+
<exclusion>
26+
<groupId>org.springframework.boot</groupId>
27+
<artifactId>spring-boot-starter-tomcat</artifactId>
28+
</exclusion>
29+
</exclusions>
30+
</dependency>
31+
32+
<!-- 添加tomcat servlet api -->
33+
<dependency>
34+
<groupId>org.apache.tomcat</groupId>
35+
<artifactId>tomcat-servlet-api</artifactId>
36+
<version>8.0.36</version>
37+
<scope>provided</scope>
38+
</dependency>
39+
40+
<!-- 添加thymeleaf为了动态解析html-->
41+
<dependency>
42+
<groupId>org.springframework.boot</groupId>
43+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
44+
</dependency>
45+
46+
<!-- 处理jdbc的mysql连接-->
47+
<dependency>
48+
<groupId>mysql</groupId>
49+
<artifactId>mysql-connector-java</artifactId>
50+
<version>8.0.12</version>
51+
</dependency>
52+
53+
<!-- 处理json数据 -->
54+
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
55+
<dependency>
56+
<groupId>com.alibaba</groupId>
57+
<artifactId>fastjson</artifactId>
58+
<version>1.2.24</version>
59+
</dependency>
60+
61+
62+
<!-- jdom解析xml 最新版本为2.0.6 时间为2015-02-28 https://github.com/hunterhacker/jdom/releases-->
63+
<!-- https://mvnrepository.com/artifact/org.jdom/jdom2 -->
64+
<dependency>
65+
<groupId>org.jdom</groupId>
66+
<artifactId>jdom2</artifactId>
67+
<version>2.0.6</version>
68+
</dependency>
69+
70+
<!-- https://mvnrepository.com/artifact/org.dom4j/dom4j -->
71+
<dependency>
72+
<groupId>org.dom4j</groupId>
73+
<artifactId>dom4j</artifactId>
74+
<version>2.1.1</version>
75+
</dependency>
76+
77+
78+
<!-- 获取url根域名-->
79+
<dependency>
80+
<groupId>com.google.guava</groupId>
81+
<artifactId>guava</artifactId>
82+
<version>21.0</version>
83+
</dependency>
84+
85+
<dependency>
86+
<groupId>commons-collections</groupId>
87+
<artifactId>commons-collections</artifactId>
88+
<version>3.1</version>
89+
</dependency>
90+
91+
<dependency>
92+
<groupId>commons-lang</groupId>
93+
<artifactId>commons-lang</artifactId>
94+
<version>2.4</version> </dependency>
95+
96+
<dependency>
97+
<groupId>org.apache.httpcomponents</groupId>
98+
<artifactId>httpclient</artifactId>
99+
<version>4.3.6</version>
100+
</dependency>
101+
<dependency>
102+
<groupId>org.apache.httpcomponents</groupId>
103+
<artifactId>fluent-hc</artifactId>
104+
<version>4.3.6</version>
105+
</dependency>
106+
107+
108+
<dependency>
109+
<groupId>org.apache.logging.log4j</groupId>
110+
<artifactId>log4j-core</artifactId>
111+
<version>2.8.2</version>
112+
</dependency>
113+
114+
<dependency>
115+
<groupId>com.squareup.okhttp</groupId>
116+
<artifactId>okhttp</artifactId>
117+
<version>2.5.0</version>
118+
</dependency>
119+
120+
121+
<dependency>
122+
<groupId>org.apache.commons</groupId>
123+
<artifactId>commons-digester3</artifactId>
124+
<version>3.2</version>
125+
</dependency>
126+
127+
</dependencies>
128+
129+
130+
131+
132+
</project>

pom-idea.xml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>sec</groupId>
8+
<artifactId>java-sec-code</artifactId>
9+
<version>1.0.0</version>
10+
<packaging>war</packaging>
11+
12+
13+
<parent>
14+
<groupId>org.springframework.boot</groupId>
15+
<artifactId>spring-boot-starter-parent</artifactId>
16+
<version>1.5.1.RELEASE</version>
17+
</parent>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>org.springframework.boot</groupId>
22+
<artifactId>spring-boot-starter-web</artifactId>
23+
</dependency>
24+
25+
26+
<!-- 添加thymeleaf为了动态解析html-->
27+
<dependency>
28+
<groupId>org.springframework.boot</groupId>
29+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
30+
</dependency>
31+
32+
<!-- 处理jdbc的mysql连接-->
33+
<dependency>
34+
<groupId>mysql</groupId>
35+
<artifactId>mysql-connector-java</artifactId>
36+
<version>8.0.12</version>
37+
</dependency>
38+
39+
<!-- 处理json数据 -->
40+
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
41+
<dependency>
42+
<groupId>com.alibaba</groupId>
43+
<artifactId>fastjson</artifactId>
44+
<version>1.2.24</version>
45+
</dependency>
46+
47+
48+
<!-- jdom解析xml 最新版本为2.0.6 时间为2015-02-28 https://github.com/hunterhacker/jdom/releases-->
49+
<!-- https://mvnrepository.com/artifact/org.jdom/jdom2 -->
50+
<dependency>
51+
<groupId>org.jdom</groupId>
52+
<artifactId>jdom2</artifactId>
53+
<version>2.0.6</version>
54+
</dependency>
55+
56+
<!-- https://mvnrepository.com/artifact/org.dom4j/dom4j -->
57+
<dependency>
58+
<groupId>org.dom4j</groupId>
59+
<artifactId>dom4j</artifactId>
60+
<version>2.1.1</version>
61+
</dependency>
62+
63+
64+
<!-- 获取url根域名-->
65+
<dependency>
66+
<groupId>com.google.guava</groupId>
67+
<artifactId>guava</artifactId>
68+
<version>21.0</version>
69+
</dependency>
70+
71+
<dependency>
72+
<groupId>commons-collections</groupId>
73+
<artifactId>commons-collections</artifactId>
74+
<version>3.1</version>
75+
</dependency>
76+
77+
<dependency>
78+
<groupId>commons-lang</groupId>
79+
<artifactId>commons-lang</artifactId>
80+
<version>2.4</version> </dependency>
81+
82+
<dependency>
83+
<groupId>org.apache.httpcomponents</groupId>
84+
<artifactId>httpclient</artifactId>
85+
<version>4.3.6</version>
86+
</dependency>
87+
<dependency>
88+
<groupId>org.apache.httpcomponents</groupId>
89+
<artifactId>fluent-hc</artifactId>
90+
<version>4.3.6</version>
91+
</dependency>
92+
93+
94+
<dependency>
95+
<groupId>org.apache.logging.log4j</groupId>
96+
<artifactId>log4j-core</artifactId>
97+
<version>2.8.2</version>
98+
</dependency>
99+
100+
<dependency>
101+
<groupId>com.squareup.okhttp</groupId>
102+
<artifactId>okhttp</artifactId>
103+
<version>2.5.0</version>
104+
</dependency>
105+
106+
107+
<dependency>
108+
<groupId>org.apache.commons</groupId>
109+
<artifactId>commons-digester3</artifactId>
110+
<version>3.2</version>
111+
</dependency>
112+
113+
</dependencies>
114+
115+
116+
117+
118+
</project>

pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,8 @@
2020
<dependency>
2121
<groupId>org.springframework.boot</groupId>
2222
<artifactId>spring-boot-starter-web</artifactId>
23-
<!-- 移除嵌入式tomcat插件,为了使用非嵌入式的tomcat -->
24-
<exclusions>
25-
<exclusion>
26-
<groupId>org.springframework.boot</groupId>
27-
<artifactId>spring-boot-starter-tomcat</artifactId>
28-
</exclusion>
29-
</exclusions>
3023
</dependency>
3124

32-
<!-- 添加tomcat servlet api -->
33-
<dependency>
34-
<groupId>org.apache.tomcat</groupId>
35-
<artifactId>tomcat-servlet-api</artifactId>
36-
<version>8.0.36</version>
37-
<scope>provided</scope>
38-
</dependency>
3925

4026
<!-- 添加thymeleaf为了动态解析html-->
4127
<dependency>

0 commit comments

Comments
 (0)