[forge-issues] [JBoss JIRA] (FORGE-440) A pom.xml which contains comments loses all of them after Forge operates on it.

Lennart Jörelid (JIRA) issues at jboss.org
Mon Feb 29 11:33:00 EST 2016


    [ https://issues.jboss.org/browse/FORGE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169682#comment-13169682 ] 

Lennart Jörelid edited comment on FORGE-440 at 2/29/16 11:32 AM:
-----------------------------------------------------------------

This is exactly the reason why I have not been able to use Forge in any of the bigger enterprise 
projects the last 3 years.

Keeping readability, XML comments and indentation for reasons of readability are 
also - to some extent - reasons to promote usability and maintainability. 
Basically, being able to read through - and quickly understand - parts of the POM contributes more to
maintainabilty of the POM (and, hence the Maven build reactor) than the ability to edit it using tools
such as Forge. 

Let's go with an example, where it is important to preserve the comment within the POM
to avoid removing an important snippet. While I understand that the Maven library to create
structures within the POM is tasty to work with, I believe that Forge needs to paint with a
bigger brush, to handle all parts of an XML file.

{code:xml}
          <!--
                 Due to problems in the Maven 3 site plugin you must enter the configuration twice,
                 once for the pluginManagement section and once for the site, see
                 http://jira.codehaus.org/browse/MSITE-516 and http://jira.codehaus.org/browse/MSITE-523
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${pmd.plugin.version}</version>
                <configuration>
                    <rulesets>
                        <ruleset>${project.build.outputDirectory}/codestyle/pmd-rules.xml</ruleset>
                    </rulesets>
                    <targetJdk>${jdk.version}</targetJdk>
                    <sourceEncoding>UTF-8</sourceEncoding>
                </configuration>
            </plugin>
{code}


was (Author: lennartj):
This is exactly the reason why I have not been able to use Forge in any of the bigger enterprise 
projects the last 3 years.

Keeping readability, XML comments and indentation for reasons of readability are 
also - to some extent - reasons to promote usability and maintainability. 
Basically, being able to read through - and quickly understand - parts of the POM contributes more to
maintainabilty of the POM (and, hence the Maven build reactor) than the ability to edit it using tools
such as Forge. 

Let's go with an example, where it is important to preserve the comment within the POM
to avoid removing an important snippet:

{code:xml}
          <!--
                 Due to problems in the Maven 3 site plugin you must enter the configuration twice,
                 once for the pluginManagement section and once for the site, see
                 http://jira.codehaus.org/browse/MSITE-516 and http://jira.codehaus.org/browse/MSITE-523
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${pmd.plugin.version}</version>
                <configuration>
                    <rulesets>
                        <ruleset>${project.build.outputDirectory}/codestyle/pmd-rules.xml</ruleset>
                    </rulesets>
                    <targetJdk>${jdk.version}</targetJdk>
                    <sourceEncoding>UTF-8</sourceEncoding>
                </configuration>
            </plugin>
{code}

> A pom.xml which contains comments loses all of them after Forge operates on it.
> -------------------------------------------------------------------------------
>
>                 Key: FORGE-440
>                 URL: https://issues.jboss.org/browse/FORGE-440
>             Project: Forge
>          Issue Type: Bug
>          Components: Build Tools - Maven
>    Affects Versions: 1.0.6.Final
>         Environment: HEAD
>            Reporter: Pete Muir
>             Fix For: 3.x Future
>
>         Attachments: pomComments.png
>
>
> Also looses formatting, but this is less of an issue.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the forge-issues mailing list