o patch to pass along the source and location

Submitted by: Jason Dillon


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@824998 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-10-14 02:05:28 +00:00
parent d5ce7b9092
commit 57f45121c3
2 changed files with 9 additions and 2 deletions

View File

@ -28,6 +28,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.DependencyManagement;
@ -298,7 +299,10 @@ private Model readModel( ModelSource modelSource, File pomFile, ModelBuildingReq
{
boolean strict = request.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0;
Map<String, ?> options = Collections.singletonMap( ModelProcessor.IS_STRICT, Boolean.valueOf( strict ) );
Map<String,Object> options = new HashMap<String,Object>();
options.put(ModelProcessor.IS_STRICT, Boolean.valueOf( strict ));
options.put(ModelProcessor.LOCATION, modelSource.getLocation());
options.put(ModelProcessor.SOURCE, modelSource);
try
{
@ -311,7 +315,7 @@ private Model readModel( ModelSource modelSource, File pomFile, ModelBuildingReq
throw e;
}
options = Collections.singletonMap( ModelProcessor.IS_STRICT, Boolean.FALSE );
options = Collections.singletonMap( ModelProcessor.IS_STRICT, (Object)Boolean.FALSE );
model = modelProcessor.read( modelSource.getInputStream(), options );

View File

@ -6,4 +6,7 @@
public interface ModelProcessor
extends ModelLocator, ModelReader
{
String LOCATION = "org.apache.maven.model.building.location";
String SOURCE = "org.apache.maven.model.building.source";
}