You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2019/02/15 12:38:13 UTC

[maven] branch MNG-6575 created (now 638de07)

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a change to branch MNG-6575
in repository https://gitbox.apache.org/repos/asf/maven.git.


      at 638de07  [MNG-6575] track input location for super-pom content

This branch includes the following new commits:

     new 638de07  [MNG-6575] track input location for super-pom content

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: [MNG-6575] track input location for super-pom content

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MNG-6575
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 638de07fa1e000055858e520f4e886dd2169854d
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Fri Feb 15 13:38:03 2019 +0100

    [MNG-6575] track input location for super-pom content
---
 .../apache/maven/model/superpom/DefaultSuperPomProvider.java  | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/superpom/DefaultSuperPomProvider.java b/maven-model-builder/src/main/java/org/apache/maven/model/superpom/DefaultSuperPomProvider.java
index 322dcae..a69ec2f 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/superpom/DefaultSuperPomProvider.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/superpom/DefaultSuperPomProvider.java
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.maven.model.InputSource;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelProcessor;
 import org.codehaus.plexus.component.annotations.Component;
@@ -70,8 +71,16 @@ public class DefaultSuperPomProvider
 
             try
             {
-                Map<String, String> options = new HashMap<>();
+                Map<String, Object> options = new HashMap<>();
                 options.put( "xml:4.0.0", "xml:4.0.0" );
+
+                String modelId = "org.apache.maven:model-builder:"
+                    + this.getClass().getPackage().getImplementationVersion() + ":super-pom";
+                InputSource inputSource = new InputSource();
+                inputSource.setModelId( modelId );
+                inputSource.setLocation( getClass().getResource( resource ).toExternalForm() );
+                options.put( ModelProcessor.INPUT_SOURCE, inputSource );
+
                 superModel = modelProcessor.read( is, options );
             }
             catch ( IOException e )