Skip to content

Commit 453e194

Browse files
committed
add jar configure
1 parent 674f2f1 commit 453e194

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

README.md

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

83-
---
83+
---
8484

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

87+
具体操作:执行`cp pom-idea.xml pom.xml`后,最后在IDEA中右键`Run Application`
8888

89+
### Jar包
8990

91+
92+
有人反馈想直接打Jar包运行。具体操作:
93+
94+
先修改pom.xml里的配置,将war改成jar
95+
96+
```
97+
<groupId>sec</groupId>
98+
<artifactId>java-sec-code</artifactId>
99+
<version>1.0.0</version>
100+
<packaging>war</packaging>
101+
```
102+
103+
再打包运行即可。
104+
105+
```
106+
mvn clean package -DskipTests
107+
java -jar 打包后的jar包路径
108+
```

pom-extra.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,14 @@
126126

127127
</dependencies>
128128

129-
129+
<build>
130+
<plugins>
131+
<plugin>
132+
<groupId>org.springframework.boot</groupId>
133+
<artifactId>spring-boot-maven-plugin</artifactId>
134+
</plugin>
135+
</plugins>
136+
</build>
130137

131138

132139
</project>

pom-idea.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,14 @@
112112

113113
</dependencies>
114114

115-
115+
<build>
116+
<plugins>
117+
<plugin>
118+
<groupId>org.springframework.boot</groupId>
119+
<artifactId>spring-boot-maven-plugin</artifactId>
120+
</plugin>
121+
</plugins>
122+
</build>
116123

117124

118125
</project>

pom.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,15 @@
112112

113113
</dependencies>
114114

115-
115+
<!-- jar -->
116+
<build>
117+
<plugins>
118+
<plugin>
119+
<groupId>org.springframework.boot</groupId>
120+
<artifactId>spring-boot-maven-plugin</artifactId>
121+
</plugin>
122+
</plugins>
123+
</build>
116124

117125

118126
</project>

0 commit comments

Comments
 (0)