Uploaded image for project: 'Maven Help Plugin'
  1. Maven Help Plugin
  2. MPH-160

help:effective-pom -Dverbose: add source location as comments in effective pom.xml

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.2.0
    • Component/s: effective-pom
    • Labels:
      None

      Description

      during in-memory effective pom building (by maven-model-builder), the source location of content is kept in memory: see Modello documentation on location tracking and MNG-1803 for its integration into Maven model

      adding this information as comment on every line of generated XML would ease tracking for end users (and not only m2e users, who get "Jump to location" hint when editing their pom.xml in Eclipse...)

      This will require a Modello enhancement (see Modello #28) then integration

      (idea found during Devoxx 2018 Maven BoF, since users were missing ways to diagnose unexpected result in effective pom)

      Sample result is the addition of comments with modelId and "line xxx" at the end of each line of generated XML:

      $ mvn -Dverbose org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT:effective-pom
      [INFO] Scanning for projects...
      [INFO] 
      [INFO] -------------< org.apache.maven.plugins:maven-help-plugin >-------------
      [INFO] Building Apache Maven Help Plugin 3.1.2-SNAPSHOT
      [INFO] ----------------------------[ maven-plugin ]----------------------------
      [INFO] 
      [INFO] --- maven-help-plugin:3.1.2-SNAPSHOT:effective-pom (default-cli) @ maven-help-plugin ---
      [INFO] 
      Effective POMs, after inheritance, interpolation, and profiles are applied:
      
      <?xml version="1.0" encoding="UTF-8"?>
      <!-- ====================================================================== -->
      <!--                                                                        -->
      <!-- Generated by Maven Help Plugin on 2019-02-15T12:52:00+01:00            -->
      <!-- See: http://maven.apache.org/plugins/maven-help-plugin/                -->
      <!--                                                                        -->
      <!-- ====================================================================== -->
      <!-- ====================================================================== -->
      <!--                                                                        -->
      <!-- Effective POM for project                                              -->
      <!-- 'org.apache.maven.plugins:maven-help-plugin:maven-plugin:3.1.2-SNAPSHOT' -->
      <!--                                                                        -->
      <!-- ====================================================================== -->
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 23 -->
        <parent>
          <artifactId>maven-plugins</artifactId>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 26 -->
          <groupId>org.apache.maven.plugins</groupId>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 27 -->
          <version>33</version>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 28 -->
          <relativePath>../../pom/maven/maven-plugins/pom.xml</relativePath>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 29 -->
        </parent>
        <groupId>org.apache.maven.plugins</groupId>  <!-- org.apache.maven.plugins:maven-plugins:[unknown-version] /home/herve/.m2/repository/org/apache/maven/plugins/maven-plugins/33/maven-plugins-33.pom, line 31 -->
        <artifactId>maven-help-plugin</artifactId>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 32 -->
        <version>3.1.2-SNAPSHOT</version>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 33 -->
        <packaging>maven-plugin</packaging>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 34 -->
        <name>Apache Maven Help Plugin</name>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 36 -->
        <description>The Maven Help plugin provides goals aimed at helping to make sense out of
          the build environment. It includes the ability to view the effective
          POM and settings files, after inheritance and active profiles
          have been applied, as well as a describe a particular plugin goal to give usage information.</description>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 37 -->
        <url>https://maven.apache.org/plugins/maven-help-plugin/</url>  <!-- org.apache.maven.plugins:maven-plugins:[unknown-version] /home/herve/.m2/repository/org/apache/maven/plugins/maven-plugins/33/maven-plugins-33.pom, line 37 -->
        <inceptionYear>2001</inceptionYear>  <!-- org.apache.maven.plugins:maven-help-plugin:3.1.2-SNAPSHOT, line 43 -->
        <organization>
          <name>The Apache Software Foundation</name>  <!-- org.apache:apache:21, line 41 -->
          <url>https://www.apache.org/</url>  <!-- org.apache:apache:21, line 42 -->
        </organization>
        <licenses>
          <license>
            <name>Apache License, Version 2.0</name>  <!-- org.apache:apache:21, line 46 -->
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>  <!-- org.apache:apache:21, line 47 -->
            <distribution>repo</distribution>  <!-- org.apache:apache:21, line 48 -->
          </license>
        </licenses>
      ...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hboutemy Herve Boutemy
                Reporter:
                hboutemy Herve Boutemy
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m