WorkspaceEntity (@NotNull MutableEntityStorage diff, @NotNull EntitySource source, @NotNull Project project) { WorkspaceEntity existingEntity = getExistingEntity(diff); if (existingEntity != null) return existingEntity; ArtifactId id; if (this.myArtifactPointer != null) { id = new ArtifactId(this.myArtifactPointer.getArtifactName()); } else { id = null; } ArtifactOutputPackagingElementEntity entity = diff.addEntity(ArtifactOutputPackagingElementEntity.create(source, entityBuilder -> { entityBuilder.setArtifact(id); return Unit.INSTANCE; })); diff.getMutableExternalMapping("intellij.artifacts.packaging.elements").addMapping(entity, this); return entity; }