protected void mergeDistributionManagement_Site( DistributionManagement target, DistributionManagement source, boolean sourceDominant, Map<Object, Object> context ) { Site src = source.getSite(); if ( src != null ) { Site tgt = target.getSite(); if ( tgt == null ) { tgt = new Site(); target.setSite( tgt ); } mergeSite( tgt, src, sourceDominant, context ); } }
@Override protected void mergeDistributionManagement_Site( DistributionManagement target, DistributionManagement source, boolean sourceDominant, Map<Object, Object> context ) { Site src = source.getSite(); if ( src != null ) { Site tgt = target.getSite(); if ( sourceDominant || tgt == null || isSiteEmpty( tgt ) ) { if ( tgt == null ) { tgt = new Site(); } tgt.setLocation( "", src.getLocation( "" ) ); target.setSite( tgt ); mergeSite( tgt, src, sourceDominant, context ); } mergeSite_ChildSiteUrlInheritAppendPath( tgt, src, sourceDominant, context ); } }
public static DistributionManagement cloneDistributionManagement( DistributionManagement src ) { if ( src == null ) { return null; } DistributionManagement result = new DistributionManagement(); result.setDownloadUrl( src.getDownloadUrl() ); result.setRelocation( cloneRelocation( src.getRelocation() ) ); result.setRepository( cloneDeploymentRepository( src.getRepository() ) ); result.setSite( cloneSite( src.getSite() ) ); result.setSnapshotRepository( cloneDeploymentRepository( src.getSnapshotRepository() ) ); result.setStatus( src.getStatus() ); return result; }
@Override public void normalize( Model model, ModelBuildingRequest request ) { if ( model == null ) { return; } model.setUrl( normalize( model.getUrl() ) ); Scm scm = model.getScm(); if ( scm != null ) { scm.setUrl( normalize( scm.getUrl() ) ); scm.setConnection( normalize( scm.getConnection() ) ); scm.setDeveloperConnection( normalize( scm.getDeveloperConnection() ) ); } DistributionManagement dist = model.getDistributionManagement(); if ( dist != null ) { Site site = dist.getSite(); if ( site != null ) { site.setUrl( normalize( site.getUrl() ) ); } } }
void distribution( DistributionManagement distribution ){ if ( distribution != null ){ p.printStartBlock( "distribution" ); if ( distribution.getRepository() != null ){ printRepositories("repository", distribution.getRepository() ); } if ( distribution.getSnapshotRepository() != null ){ printRepositories("snapshot_repository", distribution.getSnapshotRepository() ); } if ( distribution.getSite() != null ){ Site site = distribution.getSite(); p.printWithOptions( "site", options( "id", site.getId(), "name", site.getName(), "url", site.getUrl() ) ); } p.printEndBlock(); p.println(); } }
private boolean hasSite() { return getDistributionManagement().getSite() != null; }
private boolean hasSite() { return getDistributionManagement().getSite() != null; }
protected void mergeDistributionManagement_Site( DistributionManagement target, DistributionManagement source, boolean sourceDominant, Map<Object, Object> context ) { Site src = source.getSite(); if ( src != null ) { Site tgt = target.getSite(); if ( tgt == null ) { tgt = new Site(); target.setSite( tgt ); } mergeSite( tgt, src, sourceDominant, context ); } }
@Override protected void doAction() throws Exception { Properties properties = project.getProperties(); getLog().info("export siteDeployClassifier [" + siteDeployClassifier + "]"); properties.setProperty("siteDeployClassifier", siteDeployClassifier); if (isVerbose()) { getLog().info("distributionManagement site url [" + distributionSiteUrl + "]"); } project.getDistributionManagement().getSite().setUrl(distributionSiteUrl); }
/** * Return distributionManagement.site.url if defined, null otherwise. * * @param project not null * @return could be null */ private static String getDistMgmntSiteUrl( MavenProject project ) { if ( project.getDistributionManagement() != null && project.getDistributionManagement().getSite() != null ) { return urlEncode( project.getDistributionManagement().getSite().getUrl() ); } return null; }
private void updateSiteUrl(String url, String siteUrl) { project.getDistributionManagement().getSite().setUrl(siteUrl); project.setUrl(url); }
private static void setDistMgmntSiteUrl( Model model, String url ) { if ( model.getDistributionManagement() == null ) { model.setDistributionManagement( new DistributionManagement() ); } if ( model.getDistributionManagement().getSite() == null ) { model.getDistributionManagement().setSite( new Site() ); } model.getDistributionManagement().getSite().setUrl( url ); } }
@Override public void execute() throws MojoExecutionException, MojoFailureException { String siteURL = getRootProjectProperty(project, "siteURL"); siteURL = replaceProperties(siteURL); if (siteURL != null) { project.getModel().getProperties().put("siteURL", siteURL); } updateSiteUrl(replaceProperties(project.getUrl()), replaceProperties(project.getDistributionManagement().getSite().getUrl())); }