1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <xsl:transform version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
3 xmlns:
pom=
"http://maven.apache.org/POM/4.0.0"
4 exclude-result-prefixes=
"pom">
7 * Licensed to the Apache Software Foundation (ASF) under one
8 * or more contributor license agreements. See the NOTICE file
9 * distributed with this work for additional information
10 * regarding copyright ownership. The ASF licenses this file
11 * to you under the Apache License, Version 2.0 (the
12 * "License"); you may not use this file except in compliance
13 * with the License. You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
24 <xsl:output indent=
"yes"/>
26 <!-- copy all items from source to target with standard 'identity' template -->
27 <xsl:template match=
"@*|node()">
29 <xsl:apply-templates select=
"@*|node()"/>
33 <!-- if properties element doesn't exist, insert it with sourceEncoding subelement -->
34 <xsl:template match=
"pom:project[not(pom:properties)]">
36 <xsl:apply-templates select=
"@*"/>
38 <project.build.sourceEncoding
>UTF-
8</project.build.sourceEncoding
>
40 <xsl:apply-templates select=
"node()"/>
44 <!-- if properties element exists without sourceEncoding subelement, insert it -->
45 <xsl:template match=
"pom:properties[not(pom:project.build.sourceEncoding)]">
47 <xsl:apply-templates select=
"@*"/>
48 <project.build.sourceEncoding
>UTF-
8</project.build.sourceEncoding
>
49 <xsl:apply-templates select=
"node()"/>