private MavenProject buildFromSourceFileInternal( File projectDescriptor, ProjectBuilderConfiguration config, boolean checkDistributionManagementStatus ) throws ProjectBuildingException { Model model = readModel( "unknown", projectDescriptor, true ); MavenProject project = buildInternal( projectDescriptor.getAbsolutePath(), model, config, buildArtifactRepositories( getSuperModel() ), projectDescriptor, true ); if ( checkDistributionManagementStatus ) { if ( ( project.getDistributionManagement() != null ) && ( project.getDistributionManagement().getStatus() != null ) ) { String projectId = safeVersionlessKey( project.getGroupId(), project.getArtifactId() ); throw new ProjectBuildingException( projectId, "Invalid project file: distribution status must not be specified for a project outside of the repository" ); } } return project; }
if ( project.getDistributionManagement() != null && project.getDistributionManagement().getRepository() != null ) DeploymentRepository r = project.getDistributionManagement().getRepository(); if ( !StringUtils.isEmpty( r.getId() ) && !StringUtils.isEmpty( r.getUrl() ) ) if ( project.getDistributionManagement() != null && project.getDistributionManagement().getSnapshotRepository() != null ) DeploymentRepository r = project.getDistributionManagement().getSnapshotRepository(); if ( !StringUtils.isEmpty( r.getId() ) && !StringUtils.isEmpty( r.getUrl() ) )
DistributionManagement distMgmt = project.getDistributionManagement(); if ( distMgmt != null )
DistributionManagement distMgmt = project.getDistributionManagement(); if ( distMgmt != null )
public DistributionManagement getDistributionManagement() { return wrapped.getDistributionManagement(); }
/** Just here so it may be overridden by StageReleaseMojo */ void createGoals() { if ( goals == null ) { // set default goals = "deploy"; if ( project.getDistributionManagement() != null && project.getDistributionManagement().getSite() != null ) { goals += " site-deploy"; } } } }
/** Just here so it may be overridden by StageReleaseMojo */ void createGoals() { if ( goals == null ) { // set default goals = "deploy"; if ( project.getDistributionManagement() != null && project.getDistributionManagement().getSite() != null ) { goals += " site-deploy"; } } } }
/** * Return distributionManagement.site.url if defined, null otherwise. * * @param project not null * @return could be null */ private static String getDistMgmntSiteUrl( MavenProject project ) { return getDistMgmntSiteUrl( project.getDistributionManagement() ); }
/** * Return distributionManagement.site.url if defined, null otherwise. * * @param project not null * @return could be null */ private static String getDistMgmntSiteUrl( MavenProject project ) { return getDistMgmntSiteUrl( project.getDistributionManagement() ); }
public DistributionManagement getDistributionManagement() { return getMavenProject().getDistributionManagement(); }
public DistributionManagement getDistributionManagement() { return getMavenProject().getDistributionManagement(); } //-- DistributionManagement getDistributionManagement()
public DistributionManagement getDistributionManagement() { return getDelegate().getDistributionManagement(); }
/** * 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; }
@Override void createGoals() { if ( goals == null ) { // set default goals = "deploy"; if ( project.getDistributionManagement() != null && project.getDistributionManagement().getSite() != null ) { goals += " site:stage-deploy"; } } goals = StringUtils.replace( goals, "site-deploy", "site:stage-deploy" ); goals = StringUtils.replace( goals, "site:deploy", "site:stage-deploy" ); }
@Override public boolean canGenerateReport() { boolean result = super.canGenerateReport(); if ( result && skipEmptyReport ) { result = getProject().getDistributionManagement() != null; } return result; }
protected DistributionManagement findProjectDistributionManagement() { MavenProject project = getProject(); while (project != null) { DistributionManagement distributionManagement = project.getDistributionManagement(); if (distributionManagement != null) { return distributionManagement; } project = project.getParent(); } return null; }
@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); }
private void updateSiteUrl(String url, String siteUrl) { project.getDistributionManagement().getSite().setUrl(siteUrl); project.setUrl(url); }
private ArtifactRevisionIdentifier applyRelocation(ArtifactRevisionIdentifier id, MavenProject mavenProject) { if (mavenProject.getDistributionManagement() != null) { Relocation relocation = mavenProject.getDistributionManagement().getRelocation(); if (relocation != null) { String groupId = relocation.getGroupId() != null ? relocation.getGroupId() : id.getGroupId(); String artifactId = relocation.getArtifactId() != null ? relocation.getArtifactId() : id.getArtifactId(); String version = relocation.getVersion() != null ? relocation.getVersion() : id.getVersion(); return new ArtifactRevisionIdentifier(artifactId, groupId, version, id.getClassifier()); } } return id; }
@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())); }