*
* @param buildMetaDataProperties the build meta data properties.
*/
public final void provideBuildMetaData(final Properties buildMetaDataProperties)
{
final ScmControl scmControl = scmInfo.getScmControl();
if (scmControl.isAddScmInfo() && !scmControl.isOffline()
&& project.getScm() != null)
{
try
{
final ScmConnectionInfo scmConnectionInfo = loadConnectionInfo();
final ScmAccessInfo scmAccessInfo = createScmAccessInfo();
final RevisionHelper helper =
new RevisionHelper(scmInfo.getScmManager(), scmConnectionInfo,
scmAccessInfo, scmInfo.getBuildDatePattern());
helper.provideScmBuildInfo(buildMetaDataProperties, scmControl);
}
catch (final ScmRepositoryException e)
{
throw new ScmNoRevisionException(
"Unable to determine SCM revision information.", e );
}
catch (final NoSuchScmProviderException e)
{
throw new ScmNoRevisionException(
"Unable to determine SCM revision information.", e );
}
}
else
{
getLog().debug("Skipping SCM data since addScmInfo="
+ scmControl.isAddScmInfo() + ", offline="
+ scmControl.isOffline() + ", scmInfoProvided="
+ (project.getScm() != null) + ".");
}
}