Skip to content

Commit 306752b

Browse files
committed
🔥 替换统一依赖xml文件内的revision占位符
1 parent dc1e8af commit 306752b

File tree

2 files changed

+97
-28
lines changed

2 files changed

+97
-28
lines changed

api-boot-project/api-boot-dependencies/pom.xml

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<spring-cloud.version>3.1.0</spring-cloud.version>
1919
<maven-plugin-plugin.version>3.6.2</maven-plugin-plugin.version>
2020
<build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
21+
<xml-maven-plugin.version>1.0.2</xml-maven-plugin.version>
2122
</properties>
2223
<dependencyManagement>
2324
<dependencies>
@@ -31,132 +32,132 @@
3132
<dependency>
3233
<groupId>org.minbox.framework</groupId>
3334
<artifactId>api-boot</artifactId>
34-
<version>${project.version}</version>
35+
<version>${revision}</version>
3536
</dependency>
3637
<dependency>
3738
<groupId>org.minbox.framework</groupId>
3839
<artifactId>api-boot-autoconfigure</artifactId>
39-
<version>${project.version}</version>
40+
<version>${revision}</version>
4041
</dependency>
4142
<dependency>
4243
<groupId>org.minbox.framework</groupId>
4344
<artifactId>api-boot-common</artifactId>
44-
<version>${project.version}</version>
45+
<version>${revision}</version>
4546
</dependency>
4647
<dependency>
4748
<groupId>org.minbox.framework</groupId>
4849
<artifactId>api-boot-tools</artifactId>
49-
<version>${project.version}</version>
50+
<version>${revision}</version>
5051
</dependency>
5152
<dependency>
5253
<groupId>org.minbox.framework</groupId>
5354
<artifactId>api-boot-starter</artifactId>
54-
<version>${project.version}</version>
55+
<version>${revision}</version>
5556
</dependency>
5657
<dependency>
5758
<groupId>org.minbox.framework</groupId>
5859
<artifactId>api-boot-starter-http-converter</artifactId>
59-
<version>${project.version}</version>
60+
<version>${revision}</version>
6061
</dependency>
6162
<dependency>
6263
<groupId>org.minbox.framework</groupId>
6364
<artifactId>api-boot-starter-swagger</artifactId>
64-
<version>${project.version}</version>
65+
<version>${revision}</version>
6566
</dependency>
6667
<dependency>
6768
<groupId>org.minbox.framework</groupId>
6869
<artifactId>api-boot-starter-security-oauth-jwt</artifactId>
69-
<version>${project.version}</version>
70+
<version>${revision}</version>
7071
</dependency>
7172
<dependency>
7273
<groupId>org.minbox.framework</groupId>
7374
<artifactId>api-boot-starter-alibaba-oss</artifactId>
74-
<version>${project.version}</version>
75+
<version>${revision}</version>
7576
</dependency>
7677
<dependency>
7778
<groupId>org.minbox.framework</groupId>
7879
<artifactId>api-boot-starter-alibaba-sms</artifactId>
79-
<version>${project.version}</version>
80+
<version>${revision}</version>
8081
</dependency>
8182
<dependency>
8283
<groupId>org.minbox.framework</groupId>
8384
<artifactId>api-boot-starter-quartz</artifactId>
84-
<version>${project.version}</version>
85+
<version>${revision}</version>
8586
</dependency>
8687
<dependency>
8788
<groupId>org.minbox.framework</groupId>
8889
<artifactId>api-boot-starter-datasource-switch</artifactId>
89-
<version>${project.version}</version>
90+
<version>${revision}</version>
9091
</dependency>
9192
<dependency>
9293
<groupId>org.minbox.framework</groupId>
9394
<artifactId>api-boot-starter-resource-load</artifactId>
94-
<version>${project.version}</version>
95+
<version>${revision}</version>
9596
</dependency>
9697
<dependency>
9798
<groupId>org.minbox.framework</groupId>
9899
<artifactId>api-boot-starter-message-push</artifactId>
99-
<version>${project.version}</version>
100+
<version>${revision}</version>
100101
</dependency>
101102
<dependency>
102103
<groupId>org.minbox.framework</groupId>
103104
<artifactId>api-boot-starter-mybatis-pageable</artifactId>
104-
<version>${project.version}</version>
105+
<version>${revision}</version>
105106
</dependency>
106107
<dependency>
107108
<groupId>org.minbox.framework</groupId>
108109
<artifactId>api-boot-starter-mybatis-enhance</artifactId>
109-
<version>${project.version}</version>
110+
<version>${revision}</version>
110111
</dependency>
111112
<dependency>
112113
<groupId>org.minbox.framework</groupId>
113114
<artifactId>api-boot-starter-rate-limiter</artifactId>
114-
<version>${project.version}</version>
115+
<version>${revision}</version>
115116
</dependency>
116117
<dependency>
117118
<groupId>org.minbox.framework</groupId>
118119
<artifactId>api-boot-starter-logging</artifactId>
119-
<version>${project.version}</version>
120+
<version>${revision}</version>
120121
</dependency>
121122
<dependency>
122123
<groupId>org.minbox.framework</groupId>
123124
<artifactId>api-boot-starter-logging-admin</artifactId>
124-
<version>${project.version}</version>
125+
<version>${revision}</version>
125126
</dependency>
126127
<dependency>
127128
<groupId>org.minbox.framework</groupId>
128129
<artifactId>api-boot-starter-mail</artifactId>
129-
<version>${project.version}</version>
130+
<version>${revision}</version>
130131
</dependency>
131132
<dependency>
132133
<groupId>org.minbox.framework</groupId>
133134
<artifactId>api-boot-starter-sequence</artifactId>
134-
<version>${project.version}</version>
135+
<version>${revision}</version>
135136
</dependency>
136137
<dependency>
137138
<groupId>org.minbox.framework</groupId>
138139
<artifactId>api-boot-starter-mongo-client-settings</artifactId>
139-
<version>${project.version}</version>
140+
<version>${revision}</version>
140141
</dependency>
141142
<dependency>
142143
<groupId>org.minbox.framework</groupId>
143144
<artifactId>api-boot-starter-message-pipe-client</artifactId>
144-
<version>${project.version}</version>
145+
<version>${revision}</version>
145146
</dependency>
146147
<dependency>
147148
<groupId>org.minbox.framework</groupId>
148149
<artifactId>api-boot-starter-message-pipe-server</artifactId>
149-
<version>${project.version}</version>
150+
<version>${revision}</version>
150151
</dependency>
151152
<dependency>
152153
<groupId>org.minbox.framework</groupId>
153154
<artifactId>api-boot-starter-ssh-agent</artifactId>
154-
<version>${project.version}</version>
155+
<version>${revision}</version>
155156
</dependency>
156157
<dependency>
157158
<groupId>org.minbox.framework</groupId>
158159
<artifactId>api-boot-starter-grace</artifactId>
159-
<version>${project.version}</version>
160+
<version>${revision}</version>
160161
</dependency>
161162
</dependencies>
162163
</dependencyManagement>
@@ -177,7 +178,7 @@
177178
<plugin>
178179
<groupId>org.minbox.framework</groupId>
179180
<artifactId>api-boot-maven-plugin-code-builder</artifactId>
180-
<version>${project.version}</version>
181+
<version>${revision}</version>
181182
</plugin>
182183
<plugin>
183184
<groupId>org.apache.maven.plugins</groupId>
@@ -187,9 +188,46 @@
187188
<plugin>
188189
<groupId>org.minbox.framework</groupId>
189190
<artifactId>api-boot-mybatis-enhance-maven-codegen</artifactId>
190-
<version>${project.version}</version>
191+
<version>${revision}</version>
192+
</plugin>
193+
<plugin>
194+
<groupId>org.codehaus.mojo</groupId>
195+
<artifactId>xml-maven-plugin</artifactId>
196+
<version>${xml-maven-plugin.version}</version>
191197
</plugin>
192198
</plugins>
193199
</pluginManagement>
200+
<plugins>
201+
<plugin>
202+
<groupId>org.codehaus.mojo</groupId>
203+
<artifactId>xml-maven-plugin</artifactId>
204+
<inherited>false</inherited>
205+
<executions>
206+
<execution>
207+
<id>post-process-flattened-pom</id>
208+
<phase>process-resources</phase>
209+
<goals>
210+
<goal>transform</goal>
211+
</goals>
212+
<configuration>
213+
<transformationSets>
214+
<transformationSet>
215+
<dir>${project.basedir}</dir>
216+
<outputDir>${project.basedir}</outputDir>
217+
<includes>.flattened-pom.xml</includes>
218+
<stylesheet>src/main/xslt/post-process-flattened-pom.xsl</stylesheet>
219+
<outputProperties>
220+
<outputProperty>
221+
<name>indent</name>
222+
<value>yes</value>
223+
</outputProperty>
224+
</outputProperties>
225+
</transformationSet>
226+
</transformationSets>
227+
</configuration>
228+
</execution>
229+
</executions>
230+
</plugin>
231+
</plugins>
194232
</build>
195233
</project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xsl:stylesheet version="2.0"
3+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://maven.apache.org/POM/4.0.0"
4+
exclude-result-prefixes="m">
5+
<xsl:output method="xml" encoding="utf-8" indent="yes"
6+
xslt:indent-amount="2" xmlns:xslt="http://xml.apache.org/xslt" />
7+
<xsl:strip-space elements="*" />
8+
<xsl:template match="@*|node()">
9+
<xsl:copy>
10+
<xsl:apply-templates select="@*|node()" />
11+
</xsl:copy>
12+
</xsl:template>
13+
<xsl:template match="/m:project/m:properties">
14+
<xsl:copy>
15+
<xsl:apply-templates select="node()">
16+
<xsl:sort select="name()" />
17+
</xsl:apply-templates>
18+
</xsl:copy>
19+
</xsl:template>
20+
<xsl:template
21+
match="/m:project/m:dependencyManagement/m:dependencies/m:dependency/m:version/text()[. = '${revision}']">
22+
<xsl:value-of select="/m:project/m:version/text()" />
23+
</xsl:template>
24+
<xsl:template
25+
match="/m:project/m:build/m:pluginManagement/m:plugins/m:plugin/m:version/text()[. = '${revision}']">
26+
<xsl:value-of select="/m:project/m:version/text()" />
27+
</xsl:template>
28+
<xsl:template match="/m:project/m:properties/m:revision" />
29+
<xsl:template match="/m:project/m:properties/m:main.basedir" />
30+
<xsl:template match="/m:project/m:distributionManagement" />
31+
</xsl:stylesheet>

0 commit comments

Comments
 (0)