Search in sources :

Example 1 with StartArtifactPublishEvent

use of org.apache.ivy.core.event.publish.StartArtifactPublishEvent in project ant-ivy by apache.

the class PublishEngine method publish.

private void publish(Artifact artifact, File src, DependencyResolver resolver, boolean overwrite) throws IOException {
    IvyContext.getContext().checkInterrupted();
    // notify triggers that an artifact is about to be published
    eventManager.fireIvyEvent(new StartArtifactPublishEvent(resolver, artifact, src, overwrite));
    // set to true once the publish succeeds
    boolean successful = false;
    try {
        if (src.exists()) {
            resolver.publish(artifact, src, overwrite);
            successful = true;
        }
    } finally {
        // notify triggers that the publish is finished, successfully or not.
        eventManager.fireIvyEvent(new EndArtifactPublishEvent(resolver, artifact, src, overwrite, successful));
    }
}
Also used : EndArtifactPublishEvent(org.apache.ivy.core.event.publish.EndArtifactPublishEvent) StartArtifactPublishEvent(org.apache.ivy.core.event.publish.StartArtifactPublishEvent)

Aggregations

EndArtifactPublishEvent (org.apache.ivy.core.event.publish.EndArtifactPublishEvent)1 StartArtifactPublishEvent (org.apache.ivy.core.event.publish.StartArtifactPublishEvent)1