}
private void pushNewVersionIntoProject(Artifact artifact, ArtifactVersion artifactVersion) throws ServiceException, SecurityServiceException {
if (artifact.getProject() != null) {
Project project = artifact.getProject();
ProjectVersion projectVersion = projectVersionService.getByProjectAndVersion(artifact.getProject(), artifactVersion.getVersion());
if (projectVersion == null) {
projectVersion = new ProjectVersion(artifactVersion.getVersion());
projectVersion.setStatus(ProjectVersionStatus.PUBLISHED_ON_MAVEN_CENTRAL);
projectVersionService.create(projectVersion);
project.addVersion(projectVersion);
projectService.update(project);
} else if (ProjectVersionStatus.IN_PROGRESS.equals(projectVersion.getStatus())) {
projectVersion.setStatus(ProjectVersionStatus.PUBLISHED_ON_MAVEN_CENTRAL);
}
projectVersion.setLastUpdateDate(artifactVersion.getLastUpdateDate());
projectVersionService.update(projectVersion);
artifactVersion.setProjectVersion(projectVersion);
artifactVersionService.update(artifactVersion);
}