-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpom.xml
More file actions
162 lines (160 loc) · 8.83 KB
/
pom.xml
File metadata and controls
162 lines (160 loc) · 8.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.cool</groupId>
<artifactId>demo</artifactId>
<version>1.0.0</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mybatis-plus.ext.version>3.5.6-EXT681</mybatis-plus.ext.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.26</version>
</dependency>
<!--***以上包在主应用已经引入,避免插件过大不会在打入jar包中***-->
<!--***为了开发插件如果引入了主应用已经有的maven依赖可以在下面的 maven-shade-plugin 中排除掉不打入jar***-->
<!--以下包会打入jar,主应用没有这些依赖,不然调用时会报错-->
</dependencies>
<build>
<plugins>
<!-- 配置 JAR 插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<finalName>${name}</finalName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<!--主应用以有这些依赖,打包时可以排除-->
<exclude>org.springframework:spring-beans</exclude>
<exclude>org.springframework:spring-core</exclude>
<exclude>org.springframework:spring-jcl</exclude>
<exclude>org.springframework:spring-context</exclude>
<exclude>org.springframework:spring-aop</exclude>
<exclude>org.springframework:spring-expression</exclude>
<exclude>io.micrometer:micrometer-observation</exclude>
<exclude>io.micrometer:micrometer-commons</exclude>
<exclude>jakarta.annotation:jakarta.annotation-api</exclude>
<exclude>org.slf4j:slf4j-api</exclude>
<exclude>org.projectlombok:lombok</exclude>
<exclude>cn.hutool:hutool-all</exclude>
<exclude>org.springframework.boot:spring-boot-starter-test</exclude>
<exclude>org.springframework.boot:spring-boot-starter</exclude>
<exclude>org.springframework.boot:spring-boot</exclude>
<exclude>org.springframework.boot:spring-boot-autoconfigure</exclude>
<exclude>org.springframework.boot:spring-boot-starter-logging</exclude>
<exclude>ch.qos.logback:logback-classic</exclude>
<exclude>ch.qos.logback:logback-core</exclude>
<exclude>org.apache.logging.log4j:log4j-to-slf4j</exclude>
<exclude>org.apache.logging.log4j:log4j-api</exclude>
<exclude>org.slf4j:jul-to-slf4j:jar</exclude>
<exclude>org.yaml:snakeyaml</exclude>
<exclude>org.springframework.boot:spring-boot-test</exclude>
<exclude>org.springframework.boot:spring-boot-test-autoconfigure</exclude>
<exclude>com.jayway.jsonpath:json-path</exclude>
<exclude>jakarta.xml.bind:jakarta.xml.bind-api</exclude>
<exclude>jakarta.activation:jakarta.activation-api</exclude>
<exclude>net.minidev:json-smart</exclude>
<exclude>net.minidev:accessors-smart</exclude>
<exclude>org.ow2.asm:asm:jar</exclude>
<exclude>org.assertj:assertj-core</exclude>
<exclude>net.bytebuddy:byte-buddy</exclude>
<exclude>org.awaitility:awaitility</exclude>
<exclude>org.hamcrest:hamcrest</exclude>
<exclude>org.junit.jupiter:junit-jupiter</exclude>
<exclude>org.junit.jupiter:junit-jupiter-api</exclude>
<exclude>org.opentest4j:opentest4j</exclude>
<exclude>org.junit.platform:junit-platform-commons</exclude>
<exclude>org.apiguardian:apiguardian-api</exclude>
<exclude>org.junit.jupiter:junit-jupiter-params</exclude>
<exclude>org.junit.jupiter:junit-jupiter-engine</exclude>
<exclude>org.junit.platform:junit-platform-engine</exclude>
<exclude>org.mockito:mockito-core</exclude>
<exclude>net.bytebuddy:byte-buddy-agent</exclude>
<exclude>org.objenesis:objenesis</exclude>
<exclude>org.mockito:mockito-junit-jupiter</exclude>
<exclude>org.skyscreamer:jsonassert</exclude>
<exclude>com.vaadin.external.google:android-json</exclude>
<exclude>org.springframework:spring-test</exclude>
<exclude>org.xmlunit:xmlunit-core</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy file="${project.build.directory}/${project.build.finalName}.jar"
tofile="${project.build.directory}/${artifactId}_v${version}.cool"
/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>