build-helper-maven-plugin
build-helper-maven-plugin copied to clipboard
Using parse-version with effective-pom generates invalid XML, adds <?xml...?> tag twice
Using parse-version with effective-pom generates invalid XML, adds tag twice. One before comments and another just after comments. This bug exists from v3.0.0 onwards, I checked with v1.12, and it's the last build that doesn't have this issue.
Command: mvn build-helper:parse-version help:effective-pom -N -B Sample output:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 2022-02-21T08:15:10+01:00 -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
<!-- Effective POM for project -->
<!-- 'com.xxx.xxx.core.commons:core-libraries:pom:5.0.0-SNAPSHOT' -->
<!-- -->
<!-- ====================================================================== -->
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>