build: 优化 Maven 配置

This commit is contained in:
2023-11-20 19:45:41 +08:00
parent 2c4fc7e314
commit 51d7c05902
3 changed files with 185 additions and 134 deletions

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://maven.apache.org/POM/4.0.0"
exclude-result-prefixes="m">
<xsl:output method="xml" encoding="utf-8" indent="yes"
xslt:indent-amount="2" xmlns:xslt="http://xml.apache.org/xslt" />
<xsl:strip-space elements="*" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="/m:project/m:properties">
<xsl:copy>
<xsl:apply-templates select="node()">
<xsl:sort select="name()" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template
match="/m:project/m:dependencyManagement/m:dependencies/m:dependency/m:version/text()[. = '${revision}']">
<xsl:value-of select="/m:project/m:version/text()" />
</xsl:template>
<xsl:template
match="/m:project/m:build/m:pluginManagement/m:plugins/m:plugin/m:version/text()[. = '${revision}']">
<xsl:value-of select="/m:project/m:version/text()" />
</xsl:template>
<xsl:template match="/m:project/m:properties/m:revision" />
<xsl:template match="/m:project/m:properties/m:main.basedir" />
<xsl:template match="/m:project/m:distributionManagement" />
</xsl:stylesheet>