Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1.0
-
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
- depends upon
-
MNG-1803 Provide line number information when there are errors processing a pom.xml
- Closed
- is related to
-
MNG-6599 unknown version in model id when version is defined from parent
- Closed
-
MNG-6593 track input location for super-pom
- Closed
-
MNG-6597 add input location tracking for plugins configuration
- Closed
-
MNG-6600 add input location tracking for default lifecycle bindings executions
- Closed
-
MNG-6601 add input location tracking for site's reportPlugins injected by reports conversion
- Closed
- is superceded by
-
MPH-183 Effective-pom + verbose should show import path to BOM dependencyManagement
- Open
- supercedes
-
MNG-5309 InputLocation missing for Xpp3Dom configuration elements
- Closed
- links to