[MNG-6593] track input location for super-pom content

This commit is contained in:
Hervé Boutemy 2019-02-15 13:38:03 +01:00
parent c674bcfb42
commit bd4a3a0d22
1 changed files with 10 additions and 1 deletions

View File

@ -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 )