You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Bo Wang (JIRA)" <ji...@apache.org> on 2019/01/02 10:18:00 UTC

[jira] [Updated] (MNG-6547) MavenProject.writeModel(Writer writer) outputs an error-sorted pom.xml

     [ https://issues.apache.org/jira/browse/MNG-6547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bo Wang updated MNG-6547:
-------------------------
    Description: 
When I try to rewrite a _pom.xml_ to add a plugin configuration via *MavenProject.write(Writer writer)*, the method outputs a wrong pom.xml, which triggers error of *com.google.code.sortpom:maven-sortpom-plugin:2.1.0:verify (verify-sorted-pom).*

I diff the pom.xml files and find that the order of the two tags *<phase>* and *<goals>* is changed, i.e.:

*The original section:*

<execution>
 <id>generate-thrift</id>
 *<goals>**...**</goals>*
 *<phase>*generate-sources</phase>**
 ...
 </execution>

*The error output:*

<execution>
 <id>generate-thrift</id>
 *<phase>*generate-sources</phase>**
*<goals>**...**</goals>*
 ...
 </execution>

 

The tested _[pom.xml|https://github.com/apache/accumulo/blob/1.5.1/trace/pom.xml]_ is a copy of accumo-trace v1.5.1. The simple bug-trigger code example _[^Rewriter.java] and the tested [^pom.xml]_ are attached. 

  was:
When I try to rewrite a _pom.xml_ to add a plugin configuration via *MavenProject.write(Writer writer)*, the method outputs a wrong pom.xml, which triggers error of *com.google.code.sortpom:maven-sortpom-plugin:2.1.0:verify (verify-sorted-pom).*

I diff the pom.xml files and find that the order of two tags *<phase>* and *<goals>* are changed, i.e.:

*The original section:*

<execution>
 <id>generate-thrift</id>
 *<goals>*
 <goal>exec</goal>
 *</goals>*
 *<phase>*generate-sources*</phase>*
...
 </execution>

*The error output:*

<execution>
 <id>generate-thrift</id>
 *<phase>*generate-sources*</phase>*
 *<goals>*
 <goal>exec</goal>
 *</goals>*
...
 </execution>

 

The tested _[pom.xml|https://github.com/apache/accumulo/blob/1.5.1/trace/pom.xml]_ is a copy of accumo-trace v1.5.1. The simple bug-trigger code example _[^Rewriter.java] and the tested [^pom.xml]_ are attached. 


> MavenProject.writeModel(Writer writer) outputs an error-sorted pom.xml 
> -----------------------------------------------------------------------
>
>                 Key: MNG-6547
>                 URL: https://issues.apache.org/jira/browse/MNG-6547
>             Project: Maven
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.0, 3.6.0
>         Environment: java version "1.7.0_79"
> Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
>            Reporter: Bo Wang
>            Priority: Major
>         Attachments: Rewriter.java, pom.xml
>
>
> When I try to rewrite a _pom.xml_ to add a plugin configuration via *MavenProject.write(Writer writer)*, the method outputs a wrong pom.xml, which triggers error of *com.google.code.sortpom:maven-sortpom-plugin:2.1.0:verify (verify-sorted-pom).*
> I diff the pom.xml files and find that the order of the two tags *<phase>* and *<goals>* is changed, i.e.:
> *The original section:*
> <execution>
>  <id>generate-thrift</id>
>  *<goals>**...**</goals>*
>  *<phase>*generate-sources</phase>**
>  ...
>  </execution>
> *The error output:*
> <execution>
>  <id>generate-thrift</id>
>  *<phase>*generate-sources</phase>**
> *<goals>**...**</goals>*
>  ...
>  </execution>
>  
> The tested _[pom.xml|https://github.com/apache/accumulo/blob/1.5.1/trace/pom.xml]_ is a copy of accumo-trace v1.5.1. The simple bug-trigger code example _[^Rewriter.java] and the tested [^pom.xml]_ are attached. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)