Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5392

Support XMl attributes for simple data types in POM

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.0.4
    • None
    • POM
    • None

    Description

      Maven's XML format can be a bit verbose. For example, a dependency takes 5 lines:

      <dependency>
      <groupId>com.ingg.common</groupId>
      <artifactId>common-scala</artifactId>
      <version>1.0.5</version>
      </dependency>

      This means that in an editor like mine, you can only see 5 dependencies at once.

      I could compact this like this:

      <dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.4</version><scope>test</scope></dependency>

      But (1) this is too wide for my editor at 129 chars and (2) someone will reformat it at some point! For simple data types (e.g. string or ints) if we could use attributes here it'd be shorter.

      <dependency groupId="junit" artifactId="junit" version="4.4" scope="test/>

      This would reduce tying by about 30%. Homing would faster too, making editing POMs faster, as you don't have to cursor about to find the bit you want. Finally, as more data is displayed (I could see 25 dependencies where before I could see only 5, a 500% increase in this example), it'll make a project easier and faster to understand.

      This also applies to other XML elements:

      <resource directory="src/main/resources" filtering="true"/>

      I might attach a completely reduced pom later on.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              alex.e.c Alex Collins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: