Skip to content

Commit

Permalink
[MNG-6593] track input location for super-pom content
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Feb 17, 2019
1 parent c674bcf commit bd4a3a0
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;
Expand Down Expand Up @@ -70,8 +71,16 @@ public Model getSuperModel( String version )

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 )
Expand Down

0 comments on commit bd4a3a0

Please sign in to comment.