o formatting and note on where special properties should be injected.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/branches/MNG-2766@769684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2009-04-29 06:55:02 +00:00
parent be02d72fe6
commit 260db144b1
1 changed files with 26 additions and 24 deletions

View File

@ -395,35 +395,37 @@ public class DefaultMavenProjectBuilder
private Model interpolateDomainModel( PomClassicDomainModel domainModel, ProjectBuilderConfiguration config, File projectDescriptor )
throws ProjectBuildingException
{
Model model;
try
{
model = domainModel.getModel();
}
catch (IOException e)
{
throw new ProjectBuildingException("", e.getMessage());
}
Model model;
try
{
model = domainModel.getModel();
}
catch ( IOException e )
{
throw new ProjectBuildingException( "", e.getMessage() );
}
String projectId = safeVersionlessKey( model.getGroupId(), model.getArtifactId() );
Properties props = new Properties(config.getExecutionProperties());
Properties props = new Properties( config.getExecutionProperties() );
//TODO: this magical property should not be placed in here in the middle of the project builder. move somewhere out to
// the front-end where they can all be collected.
if ( config.getBuildStartTime() != null )
{
props.put("${build.timestamp}", new SimpleDateFormat( "yyyyMMdd-hhmm" ).format( config.getBuildStartTime() ) );
}
try
{
model = interpolator.interpolateDomainModel( domainModel, props ).getModel();
}
catch ( IOException e )
{
props.put( "${build.timestamp}", new SimpleDateFormat( "yyyyMMdd-hhmm" ).format( config.getBuildStartTime() ) );
}
try
{
model = interpolator.interpolateDomainModel( domainModel, props ).getModel();
}
catch ( IOException e )
{
throw new ProjectBuildingException(projectId, "", projectDescriptor, e);
}
return model;
throw new ProjectBuildingException( projectId, "", projectDescriptor, e );
}
return model;
}
private MavenProject fromDomainModelToMavenProject(Model model, File parentFile, ProjectBuilderConfiguration config, File projectDescriptor)