org.apache.maven.model.v3_0_0.Model v3Model )
throws PomTranslationException
{
DistributionManagement distributionManagement = new DistributionManagement();
Site site = null;
String siteAddress = v3Model.getSiteAddress();
String siteDirectory = v3Model.getSiteDirectory();
if ( StringUtils.isEmpty( siteAddress ) )
{
if ( !StringUtils.isEmpty( siteDirectory ) )
{
site = new Site();
site.setId( "default" );
site.setName( "Default Site" );
site.setUrl( "file://" + siteDirectory );
}
}
else
{
if ( StringUtils.isEmpty( siteDirectory ) )
{
throw new PomTranslationException( pomKey.groupId(), pomKey.artifactId(), pomKey.version(),
"Missing 'siteDirectory': Both siteAddress and siteDirectory must be set at the same time." );
}
site = new Site();
site.setId( "default" );
site.setName( "Default Site" );
site.setUrl( "scp://" + siteAddress + "/" + siteDirectory );
}
distributionManagement.setSite( site );
String distributionSite = v3Model.getDistributionSite();